Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

79
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda