Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
filtrowanie
(version: 0)
Comparing performance of:
first vs second
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = [] const randomValues = [[], null, undefined, 1, 2, 3, 4, true, false, "", {}, 0] for (let i = 0; i < 10000000; i++) { const randomNumer = Math.floor(Math.random() * (12 - 0)) + 0; arr.push(randomValues[randomNumer]) }
Tests:
first
console.log(arr.filter(Boolean).length)
second
console.log(arr.filter(e => e).length)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
first
second
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:
Fill array with random integers
Array .push() vs .unshift() with random numbers
filtrowanie2
Array check key
Comments
Confirm delete:
Do you really want to delete benchmark?