Skip to content

Commit 46bb4d0

Browse files
Merge pull request #28 from Bobris/patch-1
Fix that only static properties could be accessed from static methods
2 parents 635c8c1 + 5349fec commit 46bb4d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ebook/24_what_new_es2022.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Now, instead, we can define them directly inside of the `class` body with the us
108108
```js
109109
class ButtonToggle extends HTMLElement {
110110

111-
#value = true;
111+
static #value = true;
112112

113113
static toggle(){
114114
this.#value = !this.#value
@@ -129,7 +129,7 @@ We can use the `static` keyword in front of fields and methods (both private and
129129
```js
130130
class ButtonToggle extends HTMLElement {
131131

132-
#value = true;
132+
static #value = true;
133133

134134
static #toggle(){
135135
this.#value = !this.#value
@@ -381,4 +381,4 @@ const student = {
381381

382382
Object.hasOwn(student,'age'); // true
383383
Object.hasOwn(student,'grade'); // false
384-
```
384+
```

0 commit comments

Comments
 (0)