GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Function binding by diogoosz · Pull Request #484 · javascript-tutorial/pt.javascript.info

Conversation

@diogoosz

@diogoosz diogoosz commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Tradução do artigo "Function binding" para o português, incluindo os exercícios.

Conforme comentado na #1.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@diogoosz @claude
Translate "Function binding" article to Portuguese
088f311
Co-Authored-By: Claude Sonnet 5 <[email protected]>
gabifs
gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/06-advanced-functions/10-bind/6-ask-partial/solution.md


1. Either use a wrapper function, an arrow to be concise:
1. Ou use uma função de invólucro, uma função seta para ficar conciso:

@gabifs gabifs Nov 12, 2026

Copy link
Copy Markdown
Contributor

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.

Terminologia inconsistente: "função seta" aqui, mas o capítulo vizinho (12-arrow-functions) usa arrow function. Leitor vê dois termos para o mesmo conceito.

Suggested change
1. Ou use uma função de invólucro, uma função seta para ficar conciso:
1. Ou use uma função invólucro (wrapper), uma *arrow function* para ficar conciso:

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gabifs
gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/06-advanced-functions/10-bind/6-ask-partial/solution.md

```js
askPassword(() => user.login(true), () => user.login(false));
```

@gabifs gabifs Nov 12, 2026

Copy link
Copy Markdown
Contributor

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.

Referente ambíguo: "o executa" concorda com user (masculino), dando a entender que se executa o objeto user. O original "runs it" se refere ao método.

Suggested change
```
Agora ela pega `user` das variáveis externas e chama o método da forma normal.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gabifs
gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/06-advanced-functions/10-bind/article.md
O método `setTimeout`, no navegador, é um pouco especial: ele define `this=window` para a chamada da função (para o Node.js, `this` se torna o objeto timer, mas isso não importa muito aqui). Então, para `this.firstName`, ele tenta obter `window.firstName`, que não existe. Em outros casos parecidos, normalmente `this` simplesmente se torna `undefined`.

The task is quite typical -- we want to pass an object method somewhere else (here -- to the scheduler) where it will be called. How to make sure that it will be called in the right context?
A tarefa é bem típica -- queremos passar um método de objeto para algum outro lugar (aqui -- para o agendador) onde ele vai ser chamado. Como garantir que ele vai ser chamado no contexto certo?

@gabifs gabifs Nov 12, 2026

Copy link
Copy Markdown
Contributor

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.

"A tarefa" soa como exercício (as tarefas do capítulo também se chamam "tarefa"). No original, "task" = situação/problema.

Suggested change
A tarefa é bem típica -- queremos passar um método de objeto para algum outro lugar (aqui -- para o agendador) onde ele vai ser chamado. Como garantir que ele vai ser chamado no contexto certo?
A situação é bem típica -- queremos passar um método de objeto para algum outro lugar (aqui -- para o agendador) onde ele vai ser chamado. Como garantir que ele vai ser chamado no contexto certo?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gabifs
gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/06-advanced-functions/10-bind/article.md
Por exemplo, temos uma função `send(from, to, text)`. Então, dentro de um objeto `user`, podemos querer usar uma variante parcial dela: `sendTo(to, text)`, que envia a partir do usuário atual.

## Going partial without context
## Indo parcial sem contexto

@gabifs gabifs Nov 12, 2026

Copy link
Copy Markdown
Contributor

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.

Título é decalque literal de "Going partial without context"; "Indo parcial" não é idiomático em PT.

Suggested change
## Indo parcial sem contexto
## Aplicação parcial sem contexto

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gabifs
gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/06-advanced-functions/10-bind/article.md
Quando fixamos alguns argumentos de uma função existente, a função resultante (menos universal) é chamada de *parcialmente aplicada* ou *parcial*.

Partials are convenient when we don't want to repeat the same argument over and over again. Like if we have a `send(from, to)` function, and `from` should always be the same for our task, we can get a partial and go on with it.
Parciais são convenientes quando não queremos repetir o mesmo argumento o tempo todo. Tipo se temos uma função `send(from, to)`, e `from` deveria ser sempre o mesmo para a nossa tarefa, podemos obter uma parcial e seguir com ela.

@gabifs gabifs Nov 12, 2026

Copy link
Copy Markdown
Contributor

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.

"Tipo se temos" é coloquial demais para o registro do resto do artigo.

Suggested change
Parciais são convenientes quando não queremos repetir o mesmo argumento o tempo todo. Tipo se temos uma função `send(from, to)`, e `from` deveria ser sempre o mesmo para a nossa tarefa, podemos obter uma parcial e seguir com ela.
Parciais são convenientes quando não queremos repetir o mesmo argumento o tempo todo. Por exemplo, se temos uma função `send(from, to)`, e `from` deveria ser sempre o mesmo para a nossa tarefa, podemos obter uma parcial e seguir com ela.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gabifs
gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/06-advanced-functions/10-bind/article.md
---

# Function binding
# Vínculo de função

@gabifs gabifs Nov 12, 2026

Copy link
Copy Markdown
Contributor

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.

Título "Vínculo de função" vs. corpo usa "vincular"/"vinculação" (ex.: linha 205 "vinculação em massa"). "Vinculação de função" descreve a ação (binding) e fica consistente; também é o texto exibido pelos links <info:bind> em 09-classes/01-class.

Suggested change
# Vínculo de função
# Vinculação de função

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gabifs gabifs mentioned this pull request Nov 12, 2026
Portuguese Translation Progress #1
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gabifs gabifs gabifs left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@diogoosz @gabifs
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.