3 ms·
It is not true. It's just a confusing attempt by the article to explain what happens to `this` inside Person(). If anything, it's more like: var newObj =
by laughinghan 10y ago
It is not true. It's just a confusing attempt by the article to explain what happens to `this` inside Person().
If anything, it's more like:
var newObj = Object.create(Person.prototype)
var result = Person.call(newObj)
if (typeof result === 'object' && result !== null) return result
return newObj
The article didn't explain it like that because that requires introducing the concept of .call() on functions.