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.__proto__
When I understood so far is that when new
is used, a new object is created with following 2 things
{
constructor: f <-- this is the constructor function F(), referring to itself
__proto__: Object <-- since this is not sub-classing any other Object, every object except Object inherits from Object.prototype
}
Is this understanding correct?
As I run this, I get the following in the Google Developer Console
What does Value below was evaluated just now
mean?
Thanks