Hello! Just wondering how to push an empty array to an object.
I think perhaps you are misunderstanding the push method, please read this
// new object
var myo = { };
//add a property with an empty array as a value
myo.arr = [];
console.log(myo);
Hello! Just wondering how to push an empty array to an object.
I think perhaps you are misunderstanding the push method, please read this
// new object
var myo = { };
//add a property with an empty array as a value
myo.arr = [];
console.log(myo);