Improve Javascript snip.
Merge pull request #176 from Sheile/add-console-log

Improve Javascript snip.