Set initialization

Benchmark created on


Setup

const prev = new Set([1,2,3]);

Test runner

Ready to run.

Testing in
TestOps/sec
Array spread
const next = new Set([...prev, 4])
ready
Addition
const next = new Set(prev).add(4)
ready

Revisions

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