Added solution to problem 39 in javascript.