Pushing reference of an object to array
- by intacto
As far as i can see in a situation like this:
var x = [];
var y = {};
y.someProp='asd';
This doesnt work:
x.push(y);
What I want to do is add a reference of y to x so that later if I will "delete y;" I want it also to be removed from the array x.