Added javascript solution

Added javascript solution
Merge pull request #758 from jogjitu/patch-2

Added javascript solution