Merge branch 'master' of https://github.com/iliakan/javascript-tutorial-en
This commit is contained in:
commit
ad296de3d6
2 changed files with 2 additions and 2 deletions
|
@ -35,4 +35,4 @@ function checkAge(age) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Is there any difference in the bahavior of these two variants?
|
Is there any difference in the behavior of these two variants?
|
||||||
|
|
|
@ -43,7 +43,7 @@ let user = new User("John");
|
||||||
user.sayHi();
|
user.sayHi();
|
||||||
```
|
```
|
||||||
|
|
||||||
It's easy to see that the two examples are alike. Just please note that methods in a class do not have a comma between them. Notice developers sometimes forget it and put a comma between class methods, and things don't work. That's not a literal object, but a class syntax.
|
It's easy to see that the two examples are alike. Just please note that methods in a class do not have a comma between them. Novice developers sometimes forget it and put a comma between class methods, and things don't work. That's not a literal object, but a class syntax.
|
||||||
|
|
||||||
So, what exactly does `class` do? We may think that it defines a new language-level entity, but that would be wrong.
|
So, what exactly does `class` do? We may think that it defines a new language-level entity, but that would be wrong.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue