Added Javascript version
Merge pull request #2 from ndonnellan/master

Javascript version