problem 1: javascript