Skip to content

Commit

Permalink
Merge pull request javascript-tutorial#125 from RandyMoore/patch-1
Browse files Browse the repository at this point in the history
Change brackets to parentheses
  • Loading branch information
iliakan authored Aug 9, 2017
2 parents c6271b5 + cbb2167 commit 299c3c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 1-js/04-object-basics/06-constructor-new/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 299c3c3

Please sign in to comment.