Fixed a JS sample code to run.
Merge pull request #21 from kaisellgren/master

A small fix to make JS code sample to run