Basic Cash Register Javascript (Codecademy excercise)