problem 3 javascript