an exercise in creating and using object in JavaScript