problem 2: javascript