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; this._author = updatedAuthor;
} }
} }
const lol = new Book('anonymous'); const novel = new Book('anonymous');
console.log(lol.writer); // anonymous console.log(novel.writer); // anonymous
lol.writer = 'wut'; novel.writer = 'newAuthor';
console.log(lol.writer); // wut console.log(novel.writer); // newAuthor
``` ```
Notice the syntax used to invoke the getter and setter. They do not even look like functions. Notice the syntax used to invoke the getter and setter. They do not even look like functions.