What is difference between for ... of and forEach
2022年5月1日小于 1 分钟
for ... of
and forEach
What is difference between Question
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.