[...].reverse vs .slice.reverse (v3)

Revision 3 of this benchmark created by Dave Bosley on


Test runner

Ready to run.

Testing in
TestOps/sec
slice.reverse
[1,2,3,4,5,6,7,8,9,10].slice().reverse()
ready
reduceRight => push
[1,2,3,4,5,6,7,8,9,10].reduceRight((a, c) => (a.push(c), a), [])
ready
[...].reverse
[...[1,2,3,4,5,6,7,8,9,10]].reverse()
ready

Revisions

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

  • Revision 1: published by brianmhunt on
  • Revision 3: published by Dave Bosley on