Fixed indentation in JavaScript example
Removed trailing semicolons from examples
Merge pull request #9531 from ggam/docs-indentation

Fixed inconsistencies in JavaScript examples