Constructor functions hold an interesting purpose in JavaScript. Unlike in classical languages, they do not always mean created by. In this lesson we’ll use the new keyword to make a constructor call and work with the .constructor property.
Hi , In the last code, the last line console.log(a.constructor === Object ) // true
should be // false
.
Amazing video!.
I don't understand where it says that console.log(Foo.prototype.constructor)
prints [λ: Foo]
. I'm using this playground and it prints function Foo() {}
. Where does that lamdba symbol come from?
Don't understand...
Tyler your last example uses Object.defineProperty to reset Foo.prototype's constructor to an anonymous object. And yet when you later call console.log(a.constructor === Foo) it returns true. Why is it Foo and not Object if I created an anonymous object?