Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.from vs Spread with Node List
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Browser:
Firefox 134
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Array.from
555298.0 Ops/sec
Spread
617939.4 Ops/sec
Array.from on NodeList
245590.1 Ops/sec
Spread on NodeList
247438.2 Ops/sec
HTML Preparation code:
<ul> </ul>
Script Preparation code:
var fooSet = new Set(); var ul = document.querySelector('ul'); for(var i=0;i<100;i++) { fooSet.add(i); ul.appendChild(document.createElement('li')); } var listItems = document.querySelectorAll('li');
Tests:
Array.from
var other = Array.from(fooSet);
Spread
var other = [...fooSet];
Array.from on NodeList
var other = Array.from(listItems);
Spread on NodeList
var other = [...listItems];