new.target is undefined not empty
It is should be made know that `new.target` is `undefined` for regular function calls than say it is empty.
This commit is contained in:
parent
468e355288
commit
6b296c1770
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