Replace _.each and _.forEach with array.forEach
Replace Lodash _.each
and _.forEach
with array.forEach
.

Why is this refactoring helpful?
You can express many _.each
and _.forEach
calls with standard JavaScript. This refactoring reduces the dependency on Lodash.
What do I need to consider?
Lodash _.each
and _.forEach
iterate over array-like collections (i.e., non-arrays with a .length
property) as if they are arrays. This can lead to differences between _.forEach
and the JavaScript Array.forEach
.
Related Code Actions
- Replace _.every with array.every
- Replace _.filter with array.filter
- Replace _.map with array.map
- Replace _.some with array.some