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:
Mauricio Paternina 2019-11-20 11:57:22 -06:00
parent 183d87b707
commit 4963fce5f7

View file

@ -20,7 +20,7 @@ User.staticMethod(); // true
That actually does the same as assigning it as a property directly:
```js run
class User() { }
class User { }
User.staticMethod = function() {
alert(this === User);