instanceof vs typeof vs typeof no function vs Object.prototype.toString.call == vs Object.prototype.toString.call ===| Test case name | Result |
|---|---|
| instanceof | |
| typeof | |
| typeof no function | |
| Object.prototype.toString.call == | |
| Object.prototype.toString.call === |
| Test name | Executions per second |
|---|---|
| ✓ Object.prototype.toString.call === | 1,562,626,688 Ops/sec |
| Object.prototype.toString.call == | 1,449,307,776 Ops/sec |
| typeof | 1,285,562,240 Ops/sec |
| typeof no function | 1,106,768,384 Ops/sec |
| instanceof | 121,985,584 Ops/sec |