Skip to content

Omitting parentheses after new#3201

Merged
iliakan merged 1 commit intojavascript-tutorial:masterfrom
web-dev-sam:patch-1
Oct 1, 2022
Merged

Omitting parentheses after new#3201
iliakan merged 1 commit intojavascript-tutorial:masterfrom
web-dev-sam:patch-1

Conversation

@web-dev-sam
Copy link
Contributor

Parentheses can be omitted even if the constructor function has arguments:

new function(test) {
    return { test }
}

// Works the same as
new (function(test) {
    return { test }
})();

Parentheses can be omitted even if the constructor function has arguments:
```js
new function(test) {
    return { test }
}

// Works the same as
new (function(test) {
    return { test }
})();
```
@CLAassistant
Copy link

CLAassistant commented Sep 25, 2022

CLA assistant check
All committers have signed the CLA.

@iliakan iliakan merged commit 98d0c2c into javascript-tutorial:master Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants