Tests:

Historical Performance Data aggregated from 32 community runs

Desktop Results:
Chrome 27 runs
typeof string is undefined
152.3M/s
string is undefined
12.7M/s
typeof undefined is undefined
12.5M/s
undefined is undefined
6.5M/s

Fastest: typeof string is undefined (23.5x faster)

View exact numbers
  • typeof string is undefined: 152,348,896 ops/sec
  • string is undefined: 12,741,343 ops/sec
  • typeof undefined is undefined: 12,469,086 ops/sec
  • undefined is undefined: 6,486,746 ops/sec
Firefox 5 runs
typeof string is undefined
1133.1M/s
string is undefined
1119.7M/s
undefined is undefined
1095.5M/s
typeof undefined is undefined
1017.3M/s

Fastest: typeof string is undefined (1.1x faster)

View exact numbers
  • typeof string is undefined: 1,133,128,832 ops/sec
  • string is undefined: 1,119,731,072 ops/sec
  • undefined is undefined: 1,095,505,792 ops/sec
  • typeof undefined is undefined: 1,017,315,904 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
    typeof string is undefined
    typeof undefined is undefined
    string is undefined
    undefined is undefined

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134 on Mac OS X 10.15.7
View result in a separate tab
undefined is undefined
244.0M/s
typeof string is undefined
235.5M/s
string is undefined
226.7M/s
typeof undefined is undefined
224.2M/s
View exact numbers
Test name Executions per second
undefined is undefined 243,970,304 Ops/sec
typeof string is undefined 235,450,816 Ops/sec
string is undefined 226,660,032 Ops/sec
typeof undefined is undefined 224,156,416 Ops/sec