While building a game where there is nested array grid to represent tiles , i was trying to determine "neighboring" tiles type , and ran into a coding mistake.
When i tried to debug , i wanted to console.log some objects , but my browser gave me weird output. When the object is written on one line , the values seem to be somewhat right ( except for that mistake of mine ) but when i wanted to display the rest of the object (click and roll-down) , it showed me entirely different values. Is this caused by me ?
For better illustration , here is a screenshot
The object is declared like this
var TileFactory = function(){
this.l={
x:null,
y:null
};
this.neighbours={
top:null,
topR:null,
topL:null,
r:null,
l:null,
bot:null,
botR:null,
botL:null
};
this.buffer;
};
And then , this is manipulated via method several times ( chain of conditions ) rapidly