Currying by diogoosz · Pull Request #488 · javascript-tutorial/pt.javascript.info
Repository navigation
Currying - #488
Merged
gabifs merged 2 commits into javascript-tutorial:master from diogoosz:translate-currying Nov 13, 2026
Merged
Currying #488 gabifs merged 2 commits into javascript-tutorial:master from diogoosz:translate-currying
Conversation
diogoosz commented Nov 9, 2026
Copy link Copy Markdown
Contributor
Tradução do artigo "Currying" para o português.
Conforme comentado na #1 .
Translate "Currying" article to Portuguese
f8d2b66
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/99-js-misc/03-currying-partials/article.md
Outdated
| - When it is called like `curriedSum(1)`, the argument is saved in the Lexical Environment, and a new wrapper is returned `function(b)`. | ||
| - Then this wrapper is called with `2` as an argument, and it passes the call to the original `sum`. | ||
| - O resultado de `curry(func)` é um invólucro `function(a)`. | ||
| - Quando ele é chamado como `curriedSum(1)`, o argumento é salvo no Ambiente Léxico, e um novo invólucro é retornado, `function(b)`. |
View reviewed changes
Comment thread 1-js/99-js-misc/03-currying-partials/article.md
Outdated
|
|
||
| 1. If passed `args` count is the same or more than the original function has in its definition (`func.length`) , then just pass the call to it using `func.apply`. | ||
| 2. Otherwise, get a partial: we don't call `func` just yet. Instead, another wrapper is returned, that will re-apply `curried` providing previous arguments together with the new ones . | ||
| 1. Se a quantidade de `args` passados for igual ou maior do que a função original tem na sua definição (`func.length`) , então só passa a chamada pra ela usando `func.apply`. |
View reviewed changes
Comment thread 1-js/99-js-misc/03-currying-partials/article.md
Outdated
| ``` | ||
|
|
||
| Now we can easily make a convenience function for current logs: | ||
| Agora podemos facilmente fazer uma função de conveniência para os logs atuais : |
View reviewed changes
Comment thread 1-js/99-js-misc/03-currying-partials/article.md
Outdated
| ``` | ||
|
|
||
| When we run it, there are two `if` execution branches : | ||
| Quando rodamos ela, existem duas ramificações de execução do `if`: |
View reviewed changes
Comment thread 1-js/99-js-misc/03-currying-partials/article.md
Outdated
| O currying exige que a função tenha um número fixo de argumentos . | ||
|
|
||
| A function that uses rest parameters, such as `f(...args)`, can't be curried this way . | ||
| Uma função que usa parâmetros rest, como `f(...args)`, não pode ter o currying feito dessa forma . |
View reviewed changes
Comment thread 1-js/99-js-misc/03-currying-partials/article.md
Outdated
| Por definição, o currying deveria converter `sum(a, b, c)` em `sum(a)(b)(c)`. | ||
|
|
||
| But most implementations of currying in JavaScript are advanced, as described: they also keep the function callable in the multi-argument variant . | ||
| Mas a maioria das implementações de currying no JavaScript são avançadas, como descrito: elas também mantêm a função chamável na variante com múltiplos argumentos . |
Apply review feedback from @gabifs
da3aade
- Standardize "Ambiente Léxico" -> "Ambiente Lexical", matching the term used elsewhere in the repo (e.g. 07-new-function) - "logs atuais" -> "logs com a hora atual" (current logs != logs with the current timestamp) - "Quando rodamos ela" -> "Quando a executamos" - Fix broken comparison: "igual ou maior do que a função original tem" -> "...do que a quantidade que a função original tem"; reword "então só passa a chamada" -> "então simplesmente repassa a chamada" - "não pode ter o currying feito dessa forma" -> "não pode passar por currying dessa forma" - Fix subject/verb agreement: "a maioria das implementações ... são avançadas... elas também mantêm" -> "...é avançada... também mantém" (single subject, avoids ambiguous "elas") - Standardize informal "pra" to "para" throughout Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
diogoosz commented Nov 13, 2026
Copy link Copy Markdown
Contributor
Author
|
Obrigado, @gabifs ! Apliquei tudo: "Ambiente Léxico"→"Ambiente Lexical" (padronizando com o resto do repo), "logs atuais"→"logs com a hora atual", "Quando rodamos ela"→"Quando a executamos", corrigi a comparação quebrada e o trecho coloquial na linha 167, "não pode ter o currying feito dessa forma"→"não pode passar por currying dessa forma", corrigi a concordância na linha 181 (sujeito único, sem o "elas" ambíguo), e padronizei "pra" para "para" no resto do texto. |
4fb74d4
into
javascript-tutorial : master
Nov 13, 2026
1 check passed
Sign up for free
to join this conversation on GitHub .
Already have an account?
Sign in to comment