Clean up javascript snippets

* No semis
* Faster for loop

Signed-off-by: Tim Smart <tim@fostle.com>