Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0
Chrome 125
Mac OS X 10.15.7
Desktop
2 years ago
Benchmark.js
Object.hasOwnProperty
11.9M/s
Object in
11.1M/s
direct
11.0M/s
Object.prototype.hasOwnProperty.call(this.storeIndex, index)
7.4M/s
Reflect.has()
6.2M/s
Array.indexOf
1.4M/s
Array includes
1.4M/s
View exact numbers
Test name Executions per second
Object.hasOwnProperty 11,912,045 Ops/sec
Object in 11,115,542 Ops/sec
direct 10,958,311 Ops/sec
Object.prototype.hasOwnProperty.call(this.storeIndex, index) 7,371,888 Ops/sec
Reflect.has() 6,152,985 Ops/sec
Array.indexOf 1,372,084 Ops/sec
Array includes 1,362,670 Ops/sec
Script Preparation code:
Tests: