Commit Problem 1 in JS