Change brackets to parentheses

From my experience brackets are {}.  () are referred to as parentheses, or perhaps "round brackets" but that would be too wordy.
This commit is contained in:
RandyMoore 2017-08-06 21:27:01 -05:00 committed by GitHub
parent c6271b5c58
commit cbb2167bb4

View file

@ -162,16 +162,16 @@ 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 brackets"
By the way, we can omit brackets after `new`, if it has no arguments:
````smart header="Omitting parentheses"
By the way, we can omit parentheses after `new`, if it has no arguments:
```js
let user = new User; // <-- no brackets
let user = new User; // <-- no parentheses
// same as
let user = new User();
```
Omitting brackets here is not considered a "good style", but the syntax is permitted by specification.
Omitting parentheses here is not considered a "good style", but the syntax is permitted by specification.
````
## Methods in constructor