Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
Firefox 93
Windows
Desktop
3 years ago
Test name Executions per second
lodash isNil 379098208.0 Ops/sec
native isNil 267650256.0 Ops/sec
HTML Preparation code:
AخA
 
1
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
 
var a = null;
var b = undefined;
var c = NaN;
var d = false;
var e = 'a';
var f = 0;
Tests:
  • lodash isNil

     
    _.isNil(a);
    _.isNil(b);
    _.isNil(c);
    _.isNil(d);
    _.isNil(e);
    _.isNil(f);
  • native isNil

     
    a == null
    b == null
    c == null
    d == null
    e == null
    f == null