Javascript References Array -


I have a large multi-dimensional array that holds the references to objects and being able to move me from one place in the context Should the array remove the second and then remove the original context (or set it to undefine), the problem with it is that the recent reference has been removed.

  var data = [[new ob, new obja], [new ob, new ob]]; Move functions (top, under, tox, toy) {data [talk] [toy] = data [oxx] [ony]; Delete data [fromx] [fromy]; }  Edit:  I mean that both have gone  data [tox] [toy]  === undefined; Both references are lost, not just the  data [fromx] [fromy]  

< P> Yes, it is just doing the delete operator which is going to do it, which is to delete the object which is known from [fromx, fromy]. Just try setting data from [fromx] [fromy] to null or allYourBaseBelongToUs (at least I hope that It is undefined)

  • ol>

    Comments