var state = {
item1 : {
text : "hi hi"
}
}
var i = 5;
function test() {
state.item1.text = i;
console.log(state)
i--
if (i >= 0) {
setTimeout(test, 1000);
}
}
test();
There is a very weird issue where when updating this json object it does not show the correct value. Any help is much appreciated. If I were to console log console.log(state.item1)
it would print the correct value. But console.log(state)
shows the incorrect value.
Codepen Example http://codepen.io/chrisburgin95/pen/xEzvWz