JavaScript object that will keep accurate score in a ten-pin  bowling match for a single player, with unit tests in place to prove the accuracy of   your scoring mechanism.