I have the following struct (or class?) in JavaScript:
function ImageStruct() {
this.id = -1;
this.isCover = true;
this.isPaired = false;
this.row = -1;
this.column = -1;
}
I add this class to a bidimensional array.
var imgStruct = new ImageStruct();
imgStruct.id = id;
imgStruct.row = row;
imgStruct.column = column;
$.myNameSpace.matrixPos[row][column] = imgStruct;
When I do something like this:
var imgStrc = $.myNameSpace.matrixPos[row][column];
If I modify imgStrc
, object in $.myNameSpace.matrixPos[row][column]
doesn't reflect that changes.
Is there any way to 'fix' this?