DEV Community

Discussion on: Difference between for...of and for...in loop in JavaScript.

Collapse
 
ddasb profile image
Damien Da Silva Bregieiro

For of came with ES2015 and is currently a better practice :

  • More readable
  • No callbacks
  • Faster (Refering to some benchmark but not sure)
  • You can also use .entries() and destructuring