Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0
Chrome 131
Mac OS X 10.15.7
Desktop
one year ago
Benchmark.js
Object.hasOwnProperty
27.4M/s
Object in
23.2M/s
direct
22.7M/s
Object.prototype.hasOwnProperty.call(this.storeIndex, index)
22.2M/s
Reflect.has()
13.9M/s
Array.indexOf
1.4M/s
Array includes
1.4M/s
View exact numbers
Test name Executions per second
Object.hasOwnProperty 27,436,400 Ops/sec
Object in 23,178,378 Ops/sec
direct 22,657,588 Ops/sec
Object.prototype.hasOwnProperty.call(this.storeIndex, index) 22,163,384 Ops/sec
Reflect.has() 13,901,616 Ops/sec
Array.indexOf 1,411,909 Ops/sec
Array includes 1,393,157 Ops/sec
Script Preparation code:
Tests: