HTML Preparation code:
AخA
 
1
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.core.js"></script>
Script Preparation code:
 
var myArray = [];
var myObject = {};
var myString = '';
var myNumber = 0.5;
var myInfinity = Infinity;
var myFunction = () => {};
var myNull = null;
var myUndefined = undefined;
Tests:
  • lodash sanity checks

    x
     
    var myValue;
    if(_.isArray(myArray)) { myValue = "array"; }
    if(_.isObject(myObject)) { myValue = "object"; }
    if(_.isString(myString)) { myValue = "string"; }
    if(_.isNumber(myNumber)) { myValue = "number"; }
    if(_.isFinite(myInfinity)) { myValue = "infinity"; }
    if(_.isFunction(myFunction)) { myValue = "function"; }
    if(_.isNull(myNull)) { myValue = "null"; }
    if(_.isUndefined(myUndefined)) { myValue = "undefined"; }
  • Native

     
    var myValue;
    if(Array.isArray(myArray)) { myValue = "array"; }
    if((typeof myObject === "object") && (myObject !== null)) { myValue = "object"; }
    if(typeof myString === "string") { myValue = "string"; }
    if(typeof myNumber === "number") { myValue = "number"; }
    if((!isNaN(myInfinity)) && (isFinite(myInfinity))) { myValue = "infinity"; }
    if(typeof myFunction === "function") { myValue = "function"; }
    if(myNull === null) { myValue = "null"; }
    if(myUndefined === undefined) { myValue = "undefined"; }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    lodash sanity checks
    Native

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 6 years ago)
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Chrome 69 on Windows 7
View result in a separate tab
Test name Executions per second
lodash sanity checks 285212.7 Ops/sec
Native 370879.2 Ops/sec