sets with array.from+concat vs array spread

Benchmark created on


Setup

const setA = new Set([1,2,3,4,5])
const setB = new Set([6, 7, 8, 9, 0])

Test runner

Ready to run.

Testing in
TestOps/sec
Array.from + concat
[].concat(Array.from(setA), Array.from(setB))
ready
Array spread
[...setA, ...setB]
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.