Is there some difference between using Array.from(document.querySelectorAll('div'))
or [...document.querySelectorAll('div')]
?
Here is a example:
let spreadDivArray = [...document.querySelectorAll('div')];
console.log(spreadDivArray);
let divArrayFrom = Array.from(document.querySelectorAll('div'));
console.log(divArrayFrom);
The console.log()
will log the same result.
Is there any performance difference?