.slice() vs .map()

Benchmark created by Andrey Mikhaylov (lolmaus) on


Setup

var arr = Array(10000).fill(0).map((e, i) => i)

Test runner

Ready to run.

Testing in
TestOps/sec
slice
arr.slice()
ready
map
arr.map(e => e)
ready

Revisions

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

  • Revision 1: published by Andrey Mikhaylov (lolmaus) on