-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prototypal inheritance #230
Changes from all commits
cdfbd74
ba63e6e
af54f5a
df77cc5
ad9565b
8421ec7
b9f7d08
639b458
cf5852a
2e70145
b1febce
c574482
367c032
768e03f
b0ee5f6
4cccda8
9bb0f1b
f619d4a
8ae513a
584d0cd
b2076f8
b2fd68a
9a93479
5413d85
7c49cf7
c7201ce
19f7f94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
1. `true`, taken from `rabbit`. | ||
2. `null`, taken from `animal`. | ||
3. `undefined`, there's no such property any more. | ||
1. `true`, obtido de `rabbit`. | ||
2. `null`, obtido de `animal`. | ||
3. `undefined`, essa propriedade não existe mais. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Traduzir as variáveis |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Traduzir o código |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Traduzir o código |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Traduzir as variáveis |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
**The answer: `rabbit`.** | ||
**A resposta: `rabbit`.** | ||
|
||
That's because `this` is an object before the dot, so `rabbit.eat()` modifies `rabbit`. | ||
Isso porque `this` é o objeto antes do ponto, então `rabbit.eat()` modifica `rabbit`. | ||
|
||
Property lookup and execution are two different things. | ||
Procurar e executar propriedades são duas coisas diferentes. | ||
|
||
The method `rabbit.eat` is first found in the prototype, then executed with `this=rabbit`. | ||
O método `rabbit.eat` primeiro é encontrado no protótipo, depois é exectado com `this=rabbit`. |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Traduzir o código |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Traduzir o código |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Traduzir o código |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.