bob['height'] = 1.8;
bob['hair'] = 'blonde'; // is the same as
bob = {};
bob.height = 1.8;
bob.hair = 'blonde'; // is the same as
bob = {
height: 1.8,
hair: 'blonde'
}
let bob = [];
bob['height'] = 1.8;
bob['hair'] = 'blonde';
JSON.stringify(bob);
You will get [] as response. That was the case as I’ve transferred my “array” via Meteor.call. I’ve read on SO that named keys aren’t allowed within an “array”, instead you have to use a “real” object.