File tree 1 file changed +4
-4
lines changed
1-js/04-object-basics/06-constructor-new
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -162,16 +162,16 @@ alert( new SmallUser().name ); // John
162
162
163
163
Usually constructors don't have a ` return ` statement. Here we mention the special behavior with returning objects mainly for the sake of completeness.
164
164
165
- ```` smart header="Omitting brackets "
166
- By the way, we can omit brackets after `new`, if it has no arguments:
165
+ ```` smart header="Omitting parentheses "
166
+ By the way, we can omit parentheses after `new`, if it has no arguments:
167
167
168
168
```js
169
- let user = new User; // <-- no brackets
169
+ let user = new User; // <-- no parentheses
170
170
// same as
171
171
let user = new User();
172
172
```
173
173
174
- Omitting brackets here is not considered a "good style", but the syntax is permitted by specification.
174
+ Omitting parentheses here is not considered a "good style", but the syntax is permitted by specification.
175
175
````
176
176
177
177
## Methods in constructor
You can’t perform that action at this time.
0 commit comments