Problem 15 in js