The bowling game kata, in JavaScript