Skip to content

Commit 267eec5

Browse files
committed
Fix invalid code snippet in 23.2.
1 parent d97d62a commit 267eec5

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2502,16 +2502,26 @@ Other Style Guides
25022502
25032503
```javascript
25042504
// bad
2505-
dragon.age();
2506-
2507-
// good
2508-
dragon.getAge();
2509-
2510-
// bad
2511-
dragon.age(25);
2512-
2505+
class Dragon {
2506+
get age() {
2507+
// ...
2508+
}
2509+
2510+
set age(value) {
2511+
// ...
2512+
}
2513+
}
2514+
25132515
// good
2514-
dragon.setAge(25);
2516+
class Dragon {
2517+
getAge() {
2518+
// ...
2519+
}
2520+
2521+
setAge(value) {
2522+
// ...
2523+
}
2524+
}
25152525
```
25162526
25172527
<a name="accessors--boolean-prefix"></a><a name="23.3"></a>

0 commit comments

Comments
 (0)