Got a wierd problem. I console.log an object. As you can see in the picture, on object is undefined but when i flip it out you can see it have an array.
If i console.log obj.matchcvs
i get undefined
How can this be? Bug in chrome dev tools?
Got a wierd problem. I console.log an object. As you can see in the picture, on object is undefined but when i flip it out you can see it have an array.
If i console.log obj.matchcvs
i get undefined
How can this be? Bug in chrome dev tools?
When you click on object in dev tools and "opens" it chrome displays it's current state. But when the object is shown in "short" version, only snapshot version of object is displayed that was created when the console.log function was called.
(function(){
var a = { x: 0 };
// Log variable "a", current snapshot is saved
console.log(a);
// Now modify the variable
a.x = 1;
})()
Try to run this code in your dev tools, you will see that "short" version displays object with property x
set to 0, when you opens it, property x
is set to 1. That is because when the snapshot was created, property x
was set to 0.