Piggy Bank Representation in JavaScript