Messing around with objects in JS