Skip to content Skip to sidebar Skip to footer

"value Below Was Evaluated Just Now", What Does It Mean?

Folks! I am trying to list down what happens behind the scenes when new keyword is used to create an instance. Here is what my code looks like function F() {} let f1 = new F() f1._

Solution 1:

Simply what it says is that the console evaluated the object just as you press the expand icon. Here is a test.

  1. Type o = {} in the console. The output will be something like >{}. DON'T EXPAND YET!

  2. Add a property to the o object. o.x = 1

  3. Now go back and expand the previous output. It will have the x property you added obviously after that output was created. But the the output still have the x value.

Because...

The value was evaluated right at the time you expanded the output - not the time it was created.

Solution 2:

Value below was evaluated just now

Basically means that what you are seeing is the value of the object at the moment you're viewing it in the console. This is useful info in case you're using for example console.log(someObject) in your app code.

What it's telling you is that what you're seeing in the browser console is the current value of someObject, and not necessarily the value that object had at the moment console.log was executed (the object may have been different at that point in code execution).

Basically this is because it's just referencing the object, and the properties/methods are not visible until you expand it in the console window.

Post a Comment for ""value Below Was Evaluated Just Now", What Does It Mean?"