Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4306.0 Safari/537.36
Chrome 88
Mac OS X 10.15.6
Desktop
4 years ago
Test name Executions per second
Lodash isPlainObject 1369233.0 Ops/sec
JS String Type Check 3000377.2 Ops/sec
HTML Preparation code:
AخA
 
1
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.20/lodash.min.js"></script>
Script Preparation code:
 
var sampleObject = {
        "id": "0001",
        "type": "donut",
        "name": "Cake",
        "ppu": 0.55
    };
var isObject;
Tests:
  • Lodash isPlainObject

     
    isObject = _.isPlainObject(sampleObject);
  • JS String Type Check

     
    isObject = Object.prototype.toString.call(sampleObject) === '[object Object]';