-
Notifications
You must be signed in to change notification settings - Fork 110
Reference Type #423
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
jonnathan-ls
merged 4 commits into
javascript-tutorial:master
from
danilolmc:update-reference-type
Mar 3, 2024
Merged
Reference Type #423
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b207bc5
it updates reference type article
danilolmc de254ee
Merge branch 'master' of github.com:danilolmc/pt.javascript.info into…
danilolmc d2a15f7
fix: it fixes grammar mistakes
danilolmc b251d2c
refactor: fixs spelling and non-existent code opening syntax
jonnathan-ls 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
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,20 @@ | ||
Aqui estão as explicações. | ||
|
||
Here's the explanations. | ||
1. Isso é uma chamada de método de objeto regular. | ||
|
||
1. That's a regular object method call. | ||
2. O mesmo, parênteses não alteram a ordem das operações aqui, o ponto é executado primeiro de qualquer maneira. | ||
|
||
2. The same, parentheses do not change the order of operations here, the dot is first anyway. | ||
|
||
3. Here we have a more complex call `(expression)()`. The call works as if it were split into two lines: | ||
3. Aqui temos uma chamada mais complexa (expressão)(). A chamada funciona como se estivesse dividida em duas linhas: | ||
|
||
```js no-beautify | ||
f = obj.go; // calculate the expression | ||
f(); // call what we have | ||
f = obj.go; // calcula a expressão | ||
f(); // chama o que temos | ||
``` | ||
|
||
Here `f()` is executed as a function, without `this`. | ||
|
||
4. The similar thing as `(3)`, to the left of the parentheses `()` we have an expression. | ||
Aqui, f() é executado como uma função, sem this. | ||
|
||
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. | ||
4. A coisa semelhante ao `(3)`, à esquerda dos parênteses `()` temos uma expressão. | ||
|
||
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`. | ||
Para explicar o comportamento de `(3)` e `(4)`, precisamos lembrar que os acessadores de propriedade (ponto ou colchetes) retornam um valor do Tipo de Referência. | ||
|
||
Qualquer operação nele, exceto uma chamada de método (como a atribuição `=` ou `||`), o transforma em um valor comum, que não carrega a informação permitindo configurar `this`. |
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
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.