to be fair - that is indeed (yet another) a subtlety of javascript. If the object is an object it's easy to add/edit/remove properties. If it's a type like a number or string (or boolean) then that can't be assigned extra properties so trying to add them will fail.