Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Slice vs Filter
(version: 0)
Comparing performance of:
filter vs slice
Created:
9 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = Array.from(Array(1000).keys()); var arr2; var index = 100;
Tests:
filter
arr2 = arr.filter(function(i) { return i !== index; });
slice
arr2 = arr.slice(0,index).concat(arr.slice(index+1));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
filter
slice
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!
Related benchmarks:
`Array.slice(-1)[0]` vs `Array[Array.length]`
`Array.slice(-1)[0]` vs `Array[Array.length]` for 10000 length
slice vs length-1
Test slice vs array.length accessing last element
JavaScript Array Slice vs Filter
Comments
Confirm delete:
Do you really want to delete benchmark?