Add JavaScript solution problem 2