An object is created with default values:
var area = {
id: id, // unique value: 0, 1, 2, 3 ...
height: 0,
width: 0,
rtmx: 0
}
then property values set to new values.
later in code we have this:
console.log(area);
console.log('id: ' + area.id);
console.log('width: ' + area.width);
console.log('height: ' + area.height);
console.log('rtmx: ' + area.rtmx);
in console:
Object {"id": 0,"height": 115,"width": 206,"rtmx": 30}
id: 0 // --> currect
width: 0 // --> incorrect, must be 206
height: 0 // --> incorrect, must be 115
rtmx: 0 // --> incorrect, must be 30
only id
has correct value others return default values from creation time.
I tries area['rtmx']
and it was the same.
It seems the very object and its property values exist, but when property values are called separately values are lost or get reset to defaults.
Any idea? I appreciate.