Syntax highlighting for JavaScript

Updated code snippets with JavaScript syntax highlighting.