Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
splice vs reduce
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0
Browser:
Firefox 125
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
if
15.4M/s
splice
8.8M/s
View exact numbers
Test name
Executions per second
✓
if
15,420,270 Ops/sec
splice
8,825,161 Ops/sec
Tests:
splice
var t = ['a', 'b', 'c', 'd']; var last = t.splice(-1) var result = t.map(el => `<span>{$el}</span>`).concat(last)
if
var t = ['a', 'b', 'c', 'd']; var result = t.map((el, index, list) => index < list.length - 1 ? `<span>${el}</span>` : el)