How does the for...of loop handle string iteration?

  • It iterates over each character in the string.
  • It treats the string as an iterable object.
  • It only works on single-character strings.
  • It throws an error when used with strings.
The for...of loop handles string iteration by iterating over each character in the string. It treats the string as an iterable object where each character is an element, allowing you to loop through and process individual characters in a string efficiently.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *