|
|
|
|
|
by gerso
3360 days ago
|
|
In reference to constructor invocation: ...a new empty object is created, (let’s name it newObj) and the function is invoked on that object,
like say, newObj.Person() in this case.
Is this true? When a function is invoked with "new", "this" is set to the object being constructed, but is that accomplished by making the constructor a method of the object being initialized? If so, it must be removed later on in the process: (new Function).Function
=> undefined
|
|
If anything, it's more like:
The article didn't explain it like that because that requires introducing the concept of .call() on functions.