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 — Iterables by diogoosz · Pull Request #461 · javascript-tutorial/pt.javascript.info

Conversation

@diogoosz

@diogoosz diogoosz commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Tradução do artigo "Iterables" para o português.

Conforme comentado na #1.

Sorry, something went wrong.

Uh oh!

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

All reactions
@diogoosz
Translate 'Iterables' article to Portuguese
dcacb19
gabifs
gabifs reviewed Nov 6, 2026
View reviewed changes
Comment thread 1-js/05-data-types/06-iterable/article.md Outdated
Ou seja, o objeto iterador fica separado do objeto sobre o qual ele itera.

Technically, we may merge them and use `range` itself as the iterator to make the code simpler.
Na prática, podemos juntar os dois e usar o próprio `range` como iterador, deixando o código mais simples.

@gabifs gabifs Nov 6, 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.

"Technically, we may merge them" fala que é possível juntar os dois. "Na prática" dá a ideia de que é o que se costuma fazer, e isso contradiz o parágrafo anterior.

Suggested change
Na prática, podemos juntar os dois e usar o próprio `range` como iterador, deixando o código mais simples.
Tecnicamente, podemos juntar os dois e usar o próprio `range` como iterador, deixando o código mais simples.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread 1-js/05-data-types/06-iterable/article.md Outdated
```

Now `range[Symbol.iterator]()` returns the `range` object itself: it has the necessary `next()` method and remembers the current iteration progress in `this.current`. Shorter? Yes. And sometimes that's fine too.
Agora `range[Symbol.iterator]()` retorna o próprio objeto `range`: ele já tem o método `next()` necessário e guarda o progresso da iteração atual em `this.current`. Mais curto? Sim. E às vezes isso é até melhor.

@gabifs gabifs Nov 6, 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.

O original diz "And sometimes that's fine too", ou seja, que às vezes isso também serve. "Até melhor" muda o sentido, e o parágrafo seguinte mostra justamente a desvantagem dessa abordagem.

Suggested change
Agora `range[Symbol.iterator]()` retorna o próprio objeto `range`: ele já tem o método `next()` necessário e guarda o progresso da iteração atual em `this.current`. Mais curto? Sim. E às vezes isso é até melhor.
Agora `range[Symbol.iterator]()` retorna o próprio objeto `range`: ele já tem o método `next()` necessário e guarda o progresso da iteração atual em `this.current`. Mais curto? Sim. E às vezes isso também serve.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread 1-js/05-data-types/06-iterable/article.md Outdated
```

And it works correctly with surrogate pairs!
E funciona corretamente até com pares substitutos (surrogate pairs)!

@gabifs gabifs Nov 6, 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.

O original não tem esse parêntese, e o artigo de unicode (1-js/99-js-misc/06-unicode) usa só "pares substitutos". Sugiro tirar o termo em inglês.

Suggested change
E funciona corretamente até com pares substitutos (surrogate pairs)!
E funciona corretamente até com pares substitutos!

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread 1-js/05-data-types/06-iterable/article.md Outdated
Isso raramente é necessário, mas nos dá mais controle sobre o processo do que o `for..of`. Por exemplo, podemos dividir o processo de iteração: iterar um pouco, parar, fazer outra coisa, e continuar depois.

## Iterables and array-likes [#array-like]
## Iteráveis e array-likes [#array-like]

@gabifs gabifs Nov 6, 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.

O termo "array-like(s)" ficou em inglês ao longo de todo o texto (linhas 166, 173–181, 196, 200, 217, 303–307), com plural em inglês. As diretrizes de tradução pedem para evitar palavras estrangeiras. Na linha 171 você já explica o termo como "parecidos com array". Que tal usar algo como "objetos semelhantes a array" no restante do texto e deixar "array-like" só nessa explicação e na âncora [#array-like]?

Suggested change
## Iteráveis e array-likes [#array-like]
## Iteráveis e objetos semelhantes a array [#array-like]

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread 1-js/05-data-types/06-iterable/article.md Outdated
Objetos *iteráveis* são uma generalização dos arrays. Esse é um conceito que permite usar qualquer objeto em um laço `for..of`.

Of course, Arrays are iterable. But there are many other built-in objects, that are iterable as well. For instance, strings are also iterable.
Claro, Arrays são iteráveis. Mas existem vários outros objetos nativos que também são iteráveis. Strings, por exemplo, também são iteráveis.

@gabifs gabifs Nov 6, 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.

Nit: "arrays" em minúsculo, como no resto do texto.

Suggested change
Claro, Arrays são iteráveis. Mas existem vários outros objetos nativos que também são iteráveis. Strings, por exemplo, também são iteráveis.
Claro, arrays são iteráveis. Mas existem vários outros objetos nativos que também são iteráveis. Strings, por exemplo, também são iteráveis.

Sorry, something went wrong.

Uh oh!

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

All reactions
@diogoosz
Apply review suggestions from gabifs
537cf50
@diogoosz

diogoosz commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Obrigado pela revisão, @gabifs! Apliquei todas as sugestões: corrigi o sentido de "technically"/"and sometimes that's fine too", removi o parêntese em inglês desnecessário, troquei "array-like(s)" por "semelhante(s) a array" no corpo do texto (mantendo só na explicação inicial e na âncora), e corrigi o "Arrays" minúsculo.

All reactions

Sorry, something went wrong.

Uh oh!

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

gabifs
gabifs approved these changes Nov 6, 2026
View reviewed changes
@gabifs
gabifs merged commit b865595 into javascript-tutorial:master Nov 6, 2026
1 check passed

Uh oh!

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

@gabifs gabifs mentioned this pull request Nov 7, 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 approved these changes

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.