Problem 3 js version

Commented js solution to problem 3