Reformat javascript code sample