use of call() with array

by andrew rowe

HTML

<span class="x">hello</span>
<span class="x">bye</span>

JavaScript

const array = [];
const spans = document.querySelectorAll('.x')
array.forEach.call(spans,x=>console.log('call', x.innerText));
spans.forEach(x=>console.log('spans',x.innerText));