fix(learn): getter setter instructions (#39512)

* Update use-getters-and-setters-to-control-access-to-an-object.english.md

* fix: revert changes, keep example

Co-authored-by: Daniel Sing <danielsingsong@gmail.com>
This commit is contained in:
Tom
2020-09-02 12:07:17 -05:00
committed by GitHub
parent 9ed2a554a7
commit 9cd4b93601

View File

@ -27,10 +27,10 @@ class Book {
this._author = updatedAuthor;
}
}
const lol = new Book('anonymous');
console.log(lol.writer); // anonymous
lol.writer = 'wut';
console.log(lol.writer); // wut
const novel = new Book('anonymous');
console.log(novel.writer); // anonymous
novel.writer = 'newAuthor';
console.log(novel.writer); // newAuthor
```
Notice the syntax used to invoke the getter and setter. They do not even look like functions.