What is the `for…of` loop used for in JavaScript?

JavaScript Associate Medium

JavaScript Associate — Medium

What is the `for…of` loop used for in JavaScript?

Key points

  • `for...of` loop is not limited to object properties
  • It works with any iterable data type
  • It follows the iterator protocol for iteration

Ready to go further?

Related questions