What I want to know
I've heard that sometimes NodeLists need to be changed to Arrays to use forEach() method. What kind of situation do I have to do it in?
What I tried
I wrote this:
const items = document.querySelectorAll('.js-li');
const arrItems = Array.from(items);
items.forEach((v, i, a) => console.log(`${v} / ${i} / ${a}`));
arrItems.forEach((v, i, a) => console.log(`${v} / ${i} / ${a}`));
<ul>
<li class="js-li">zero</li>
<li class="js-li">one</li>
<li class="js-li">two</li>
<li class="js-li">three</li>
<li class="js-li">four</li>
</ul>
But I couldn't understand the difference between with/without Array.from().