Problem 11 in js