BFE.dev
Front-End Interview Questions77. What is difference between `for ... of` and `forEach`

77. What is difference between `for ... of` and `forEach`

JavaScript
Share

We could use for...of and Array.prototype.forEach to apply functions agains elements in an array.

What is the difference?

Notice that for...of is iterating but forEach is not, this makes a huge difference in running async functions. This article explains very well on this.

prevnext
Request SolutionAIPosts(2)