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.
This commit is contained in:
parent
183d87b707
commit
4963fce5f7
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ User.staticMethod(); // true
|
||||||
That actually does the same as assigning it as a property directly:
|
That actually does the same as assigning it as a property directly:
|
||||||
|
|
||||||
```js run
|
```js run
|
||||||
class User() { }
|
class User { }
|
||||||
|
|
||||||
User.staticMethod = function() {
|
User.staticMethod = function() {
|
||||||
alert(this === User);
|
alert(this === User);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue