Script Preparation code:
Tests:

Historical Performance Data aggregated from 140 community runs

Desktop Results:
Chrome 110 runs
typeof
28.5M/s
in
28.4M/s
bool
28.3M/s
hasOwnProperty
24.9M/s
undefined
11.1M/s

Fastest: typeof (2.6x faster)

View exact numbers
  • typeof: 28,530,258 ops/sec
  • in: 28,447,060 ops/sec
  • bool: 28,251,338 ops/sec
  • hasOwnProperty: 24,852,876 ops/sec
  • undefined: 11,143,366 ops/sec
Firefox 11 runs
typeof
973.4M/s
in
900.4M/s
hasOwnProperty
873.6M/s
bool
863.7M/s
undefined
829.0M/s

Fastest: typeof (1.2x faster)

View exact numbers
  • typeof: 973,419,200 ops/sec
  • in: 900,442,496 ops/sec
  • hasOwnProperty: 873,620,032 ops/sec
  • bool: 863,692,608 ops/sec
  • undefined: 829,036,352 ops/sec
Safari 6 runs
typeof
31.8M/s
in
31.6M/s
bool
31.6M/s
hasOwnProperty
31.1M/s
undefined
11.2M/s

Fastest: typeof (2.8x faster)

View exact numbers
  • typeof: 31,798,612 ops/sec
  • in: 31,601,492 ops/sec
  • bool: 31,559,964 ops/sec
  • hasOwnProperty: 31,145,356 ops/sec
  • undefined: 11,197,392 ops/sec
Other 5 runs
typeof
254.6M/s
bool
252.9M/s
in
242.5M/s
undefined
234.6M/s
hasOwnProperty
152.9M/s

Fastest: typeof (1.7x faster)

View exact numbers
  • typeof: 254,636,880 ops/sec
  • bool: 252,883,760 ops/sec
  • in: 242,479,632 ops/sec
  • undefined: 234,631,296 ops/sec
  • hasOwnProperty: 152,875,264 ops/sec
Mobile Results:
Chrome 8 runs
typeof
18.7M/s
bool
18.7M/s
in
18.5M/s
hasOwnProperty
16.1M/s
undefined
7.5M/s

Fastest: typeof (2.5x faster)

View exact numbers
  • typeof: 18,676,362 ops/sec
  • bool: 18,654,818 ops/sec
  • in: 18,471,200 ops/sec
  • hasOwnProperty: 16,105,794 ops/sec
  • undefined: 7,504,119 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
    undefined
    typeof
    in
    hasOwnProperty
    bool

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 7 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Firefox 138 on Windows
View result in a separate tab
in
730.8M/s
hasOwnProperty
708.2M/s
undefined
695.0M/s
typeof
663.7M/s
bool
657.7M/s
View exact numbers
Test name Executions per second
in 730,780,288 Ops/sec
hasOwnProperty 708,181,056 Ops/sec
undefined 694,998,080 Ops/sec
typeof 663,690,048 Ops/sec
bool 657,673,536 Ops/sec