Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

76
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!