falsy Bouncer

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
// USING A FOR OF LOOP
function falsyBouncer(array) {
    let result =[]
    
    for (value of array){
        if(value){
            result.push(value)
        }
    }
    
    return result
}
ready
// USING .FILTER()
function falsyBouncer(array) {
    return array.filter((value) =>{
      return Boolean(value)  
    })
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.