Script Preparation code:
Tests:

Historical Performance Data aggregated from 134 community runs

Desktop Results:
Chrome 107 runs
typeof
31.1M/s
typeof and test attribute
16.0M/s
typeof no function
15.9M/s
instanceof
11.9M/s

Fastest: typeof (2.6x faster)

View exact numbers
  • typeof: 31,084,782 ops/sec
  • typeof and test attribute: 16,025,359 ops/sec
  • typeof no function: 15,903,741 ops/sec
  • instanceof: 11,893,504 ops/sec
Firefox 14 runs
typeof
1466.7M/s
typeof no function
1208.3M/s
typeof and test attribute
1100.4M/s
instanceof
156.4M/s

Fastest: typeof (9.4x faster)

View exact numbers
  • typeof: 1,466,747,520 ops/sec
  • typeof no function: 1,208,324,096 ops/sec
  • typeof and test attribute: 1,100,445,696 ops/sec
  • instanceof: 156,356,032 ops/sec
Safari 5 runs
typeof
31.6M/s
typeof no function
20.1M/s
typeof and test attribute
17.6M/s
instanceof
13.7M/s

Fastest: typeof (2.3x faster)

View exact numbers
  • typeof: 31,589,158 ops/sec
  • typeof no function: 20,110,948 ops/sec
  • typeof and test attribute: 17,595,160 ops/sec
  • instanceof: 13,700,535 ops/sec
Mobile Results:
Chrome 8 runs
typeof
72.0M/s
typeof no function
69.4M/s
typeof and test attribute
65.0M/s
instanceof
60.8M/s

Fastest: typeof (1.2x faster)

View exact numbers
  • typeof: 71,960,696 ops/sec
  • typeof no function: 69,432,776 ops/sec
  • typeof and test attribute: 65,042,920 ops/sec
  • instanceof: 60,818,016 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    instanceof
    typeof
    typeof no function
    typeof and test attribute

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
Chrome 146 on Mac OS X 10.15.7
View result in a separate tab
instanceof
295.5M/s
typeof no function
284.7M/s
typeof and test attribute
273.1M/s
typeof
268.7M/s
View exact numbers
Test name Executions per second
instanceof 295,468,928 Ops/sec
typeof no function 284,713,824 Ops/sec
typeof and test attribute 273,132,032 Ops/sec
typeof 268,715,296 Ops/sec