Skip to content

Commit 92f7f1b

Browse files
committed
fixes
1 parent 50bee36 commit 92f7f1b

File tree

1 file changed

+4
-3
lines changed
  • 1-js/07-object-properties/02-property-accessors

1 file changed

+4
-3
lines changed

1-js/07-object-properties/02-property-accessors/article.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,12 @@ alert(user.surname); // Cooper
8585
Now we have a "virtual" property. It is readable and writable, but in fact does not exist.
8686

8787
```smart header="Accessor properties are only accessible with get/set"
88-
A property can either be a "data property" or an "accessor property", but not both.
88+
Once a property is defined with `get prop()` or `set prop()`, it's an accessor property, not a data properety any more.
8989
90-
Once a property is defined with `get prop()` or `set prop()`, it's an accessor property. So there must be a getter to read it, and must be a setter if we want to assign it.
90+
- If there's a getter -- we can read `object.prop`, othrewise we can't.
91+
- If there's a setter -- we can set `object.prop=...`, othrewise we can't.
9192
92-
Sometimes it's normal that there's only a setter or only a getter. But the property won't be readable or writable in that case.
93+
And in either case we can't `delete` an accessor property.
9394
```
9495

9596

0 commit comments

Comments
 (0)