Skip to content

Commit a007239

Browse files
committed
Update article.md
1 parent ba71ec6 commit a007239

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

1-js/10-es-modern/7-es-class/article.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,17 @@ class User {
169169
*!*
170170
// вычисляемое название метода
171171
*/!*
172-
["test".toUpperCase()]: true
172+
["test".toUpperCase()]() {
173+
alert("PASSED!");
174+
}
173175

174176
};
175177

176178
let user = new User("Вася", "Пупков");
177179
alert( user.fullName ); // Вася Пупков
178180
user.fullName = "Иван Петров";
179181
alert( user.fullName ); // Иван Петров
180-
alert( user.TEST ); // true
182+
user.TEST(); // PASSED!
181183
```
182184

183185
При чтении `fullName` будет вызван метод `get fullName()`, при присвоении -- метод `set fullName` с новым значением.

0 commit comments

Comments
 (0)