add javascript prob1 solution