Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
split map reverse vs for unshift
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0
Browser:
Chrome 120
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
split map reverse
113K/s
for unshift
110K/s
View exact numbers
Test name
Executions per second
✓
split map reverse
112,608 Ops/sec
for unshift
109,800 Ops/sec
Tests:
split map reverse
function convert(num) { return num.toString().split("").map((num) => +num).reverse(); } console.log(convert(564987654));
for unshift
function convert(num) { const numTxt = num.toString(), result = []; for (let i of numTxt) { result.unshift(+i); } return result; } console.log(convert(564987654));