Merge pull request #3201 from MindLaborDev/patch-1

Omitting parentheses after `new`
This commit is contained in:
Ilya Kantor 2022-10-01 18:31:58 +02:00 committed by GitHub
commit 98d0c2c250
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -171,7 +171,7 @@ alert( new SmallUser().name ); // John
Usually constructors don't have a `return` statement. Here we mention the special behavior with returning objects mainly for the sake of completeness.
````smart header="Omitting parentheses"
By the way, we can omit parentheses after `new`, if it has no arguments:
By the way, we can omit parentheses after `new`:
```js
let user = new User; // <-- no parentheses