Add JavaScript solution problem 34