HTML Preparation code:
AخA
 
1
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.core.js"></script>
Script Preparation code:
x
 
var collection1 = undefined
var collection2 = [1, 2, 3]
var isEmpty = _.isEmpty
Tests:
  • native undefined

     
    !!(collection1 && collection1.length)
  • isEmpty undefined

     
    isEmpty(collection1)
  • native array

     
    !!(collection1 && collection1.length)
  • isEmpty array

     
    isEmpty(collection2)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    native undefined
    isEmpty undefined
    native array
    isEmpty array

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36
Chrome 94 on Windows
View result in a separate tab
Test name Executions per second
native undefined 15525742.0 Ops/sec
isEmpty undefined 6867025.0 Ops/sec
native array 15310820.0 Ops/sec
isEmpty array 7161439.5 Ops/sec