Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Reverse & find vs findLast
(version: 0)
Comparing performance of:
reverse & find vs findLast
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
const a = Array.from(Array(10000).keys()).concat(Array.from(Array(10000).keys())) function shuffle(array) { let currentIndex = array.length, randomIndex; // While there remain elements to shuffle. while (currentIndex > 0) { // Pick a remaining element. randomIndex = Math.floor(Math.random() * currentIndex); currentIndex--; // And swap it with the current element. [array[currentIndex], array[randomIndex]] = [ array[randomIndex], array[currentIndex] ]; } return array; } const arr = shuffle(a)
Tests:
reverse & find
arr.reverse().find(x=>x===500)
findLast
arr.findLast(x=>x===500)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
reverse & find
findLast
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?