-
Notifications
You must be signed in to change notification settings - Fork 31
Object methods, "this" #52
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
Merged
lighthousand
merged 12 commits into
javascript-tutorial:master
from
armino-dev:translate-object-methods-this
Feb 10, 2020
Merged
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7faa7d7
First version of romanian translation
armino-dev 3ca9d23
Initial commit
armino-dev 3896f10
More examples translated
armino-dev 5970025
Update solution.md
armino-dev c2c66e8
Update article.md
armino-dev 4c40dca
Update solution.md
armino-dev 66a0c0b
Update solution.md
armino-dev bc687d1
Update solution.md
armino-dev 35fe0a0
Update solution.md
armino-dev 84fb945
Update task.md
armino-dev 9220bbd
Update article.md
armino-dev b4fbec0
Update article.md
armino-dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 10 additions & 11 deletions
21
1-js/04-object-basics/04-object-methods/3-why-this/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,21 @@ | ||
|
|
||
| Here's the explanations. | ||
| Iată explicațiile. | ||
|
|
||
| 1. That's a regular object method call. | ||
| 1. Aceasta este o apelare normală a metodei obiectului. | ||
|
|
||
| 2. The same, brackets do not change the order of operations here, the dot is first anyway. | ||
| 2. Similar, aici, parantezele nu schimbă ordinea operațiunilor, punctul este oricum primul. | ||
|
|
||
| 3. Here we have a more complex call `(expression).method()`. The call works as if it were split into two lines: | ||
| 3. Aici avem un apel mai complex `(expression).method()`. Apelul funcționează ca și cum ar fi împărțit în două linii: | ||
|
|
||
| ```js no-beautify | ||
| f = obj.go; // calculate the expression | ||
| f(); // call what we have | ||
| f = obj.go; // calculează expresia | ||
| f(); // apelează ce avem | ||
| ``` | ||
|
|
||
| Here `f()` is executed as a function, without `this`. | ||
| Aici `f()` este executat ca funcție, fără `this`. | ||
|
|
||
| 4. The similar thing as `(3)`, to the left of the dot `.` we have an expression. | ||
| 4. Chestia similară cu `(3)`, la stânga punctului `.` avem o expresie. | ||
|
|
||
| To explain the behavior of `(3)` and `(4)` we need to recall that property accessors (dot or square brackets) return a value of the Reference Type. | ||
|
|
||
| Any operation on it except a method call (like assignment `=` or `||`) turns it into an ordinary value, which does not carry the information allowing to set `this`. | ||
| Pentru a explica comportamentul apelurilor `(3)` și `(4)` trebuie să ne reamintim că accesorii de proprietăți (punct sau paranteze pătrate) returnează o valoare de Tip Referință. | ||
|
|
||
| Orice operațiune pe aceasta, cu excepția unui apel de metodă (precum alocarea `=` sau `||`) o transformă într-o valoare obișnuită, care nu poartă informațiile ce permit setarea variabilei `this`. | ||
armino-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.