Javascript Hacker Rank