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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Browser:
Chrome 129
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
if
13.0M/s
splice
5.9M/s
View exact numbers
Test name
Executions per second
✓
if
13,014,545 Ops/sec
splice
5,920,596 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)