Problem 13 in js