Script Preparation code:
x
 
var toStr = Object.prototype.toString
    
function toStrCase(obj){
  return toStr.call(obj) === '[object Array]'
}
function consCase(obj){
  return obj && obj.constructor === Array
}
function instCase(obj){
  return obj && obj instanceof Array
}
var isArray = Array.isArray
Tests:
  • Array.isArray

     
    isArray([])
  • instanceof

     
    instCase([])
  • [].constructor

     
    consCase([])
  • Object.prototype.toString

     
    toStrCase([])
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array.isArray
    instanceof
    [].constructor
    Object.prototype.toString

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 6 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.4 Safari/605.1.15
Safari 18 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Array.isArray 483002528.0 Ops/sec
instanceof 506267712.0 Ops/sec
[].constructor 113814080.0 Ops/sec
Object.prototype.toString 105179344.0 Ops/sec