Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
silgjghjy
(version: 0)
fghfghfghfgh
Comparing performance of:
filter vs for vs for 2
Created:
5 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = [1,2,3,4,5,6,7,8,9,0], farr;
Tests:
filter
farr = arr.filter(function(item) { return (item>4); } );
for
for (var i=0,len=arr.length;i<len;i++) { if (arr[i]<5) continue; farr.push(arr[i]); }
for 2
for (var i=0,len=arr.length;i<len;i++) { if (arr[i]>4) farr.push(arr[i]); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
filter
for
for 2
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:
arr test
mapvsflatmap
arr.at(index) vs arr[index]
1htrghdr
Clone Array - 08/02/2024
Comments
Confirm delete:
Do you really want to delete benchmark?