I have a javascript object as follow:
obj = {
a: 'a',
b: 'b',
}
I add obj
to an array as follow:
arr = [];
arr.push(obj);
Now I want to delete arr[0]
. I only access to obj
, but I want to delete obj
then delete automatically arr[0]
.
How can I do it, Or Is it possible?