My question is related to circular references in JavaScript. Basically I am trying to create a js array and put the same array as a property inside itself. While I tried the below code on my firebug console, i could not reason why the below outputs happened.
var a = [];
a[a]=a;
//delete(a[a[a[a]]]); edited
delete(a[a][a][a][a]);
console.log(a[a]);
//says undefined. but i deleted the 4th nested level ??
console.log(a);
//still gives []. so a exists.
My question is, I deleted only a[a][a][a][a], so but the outer properties should still stay right? like a[a] & a[a][a] should not be undefined right?.
edit
but when i assign the array as a property with key as itself and inspected the same on firebug, I am able to expand both the key and value of the object in nested fashion, If it gets as null as key it should be visible in the inspector right?