对比展开运算符

Benchmark created on


Setup

var a = new Set();
let i = 0;
while(i < 100) {a.add('' + i); i++}

Test runner

Ready to run.

Testing in
TestOps/sec
...

var c = [...a];
ready
for
var b = [];
for (item of a) {b.push(item)}
ready

Revisions

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