Add JavaScript solution problem 10