js script that computes score in bowling -- test driven development practice