JavaScript for...in vs for...of vs forEach: Differences, break, async/await, Objects and Performance (Tested Examples)
for...in loops over the keys of an object, for...of loops over the values of an array or other iterable, and forEach calls a function for each array item. Here is how they differ with break, async/await, objects, Maps and sparse arrays, with real Node output and a speed test.