Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

85
Visualizações
When does string become an iterable object?

I read javascript.info. And I can't get something. The text is saying that strings are iterable. And here I can read that iterables are objects that implement the Symbol.iterator method.

So, when and how string becomes an iterable object? Does it mean that for..of turns primitive string into the “object wrapper”? Am I right?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Yes, the String class does have a Symbol.iterator method, and you can use for..of on a string to produce the results as in this example:

var myString = "So, when and how string becomes an iterable object?";
for (let char of myString) {
  console.log(char);
}

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda