When used as a constructor, like new MyFunction()
, the value of this will be a brand new object provided by the JavaScript runtime. If we don’t explicitly return anything from that function, this will be considered its return value.
Note
When used as a constructor, like new MyFunction()
, the value of this will be a brand new object provided by the JavaScript runtime. If we don't explicitly return anything from that function, this will be considered its return value. - true