3 ms·
The other way to deal with this particular problem is to do: [].forEach.call(myNodeList, myCallback)
by fiddlerwoaroof 9y ago
The other way to deal with this particular problem is to do:
[].forEach.call(myNodeList, myCallback)
- vkjv 9y agoGood tip, but while it works in this specific case, it isn't generally equivalent. "for of" works on anything that is iterable. This will only work on array-like objects.
- deleted 9y ago[deleted]
- Klathmon 9y agoAnd the major reason I use for-of is because you can `await` within a loop easily.