Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Slice Filter vs Index Filter
(version: 0)
Comparing performance of:
Array Slice vs Array Index
Created:
2 years ago
by:
Guest
Jump to the latest result
Tests:
Array Slice
const array = ['test','123','123','last']; const items = array.slice(1, 3).filter((el) => el === '123');
Array Index
const array = ['test','123','123','last']; const items = []; for (let i = 1; i < 3; i++) { if (array[i] === '123') { items.push(array[i]) } }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array Slice
Array Index
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?