Added Javascript solution for problem #1