Problem 19 in js