Merge pull request #2425 from sarscode/sarscode-constructor-new-target
new.target is undefined not empty
This commit is contained in:
commit
b9d5335b1d
1 changed files with 1 additions and 1 deletions
|
@ -91,7 +91,7 @@ The syntax from this section is rarely used, skip it unless you want to know eve
|
|||
|
||||
Inside a function, we can check whether it was called with `new` or without it, using a special `new.target` property.
|
||||
|
||||
It is empty for regular calls and equals the function if called with `new`:
|
||||
It is undefined for regular calls and equals the function if called with `new`:
|
||||
|
||||
```js run
|
||||
function User() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue