Skip to content

Commit 4963fce

Browse files
committedNov 20, 2019
Fix SyntaxError
When assigning the static method `staticMethod` to the `User` class, as a property directly, no parentheses should be used after `User`, since this leads to an error: `SyntaxError: Unexpected token '('`. For this reason, such parentheses have to be removed.
1 parent 183d87b commit 4963fce

File tree

1 file changed

+1
-1
lines changed
  • 1-js/09-classes/03-static-properties-methods

1 file changed

+1
-1
lines changed
 

‎1-js/09-classes/03-static-properties-methods/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ User.staticMethod(); // true
2020
That actually does the same as assigning it as a property directly:
2121

2222
```js run
23-
class User() { }
23+
class User { }
2424

2525
User.staticMethod = function() {
2626
alert(this === User);

0 commit comments

Comments
 (0)