Add JavaScript solution problem 5