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
Chrome 131
Mac OS X 10.15.7
Desktop
one year ago
Benchmark.js
Object.hasOwnProperty
6.7M/s
Object in
6.5M/s
direct
6.5M/s
Object.prototype.hasOwnProperty.call(this.storeIndex, index)
4.8M/s
Reflect.has()
3.9M/s
Array.indexOf
1.2M/s
Array includes
1.2M/s
View exact numbers
Test name Executions per second
Object.hasOwnProperty 6,731,668 Ops/sec
Object in 6,512,412 Ops/sec
direct 6,471,527 Ops/sec
Object.prototype.hasOwnProperty.call(this.storeIndex, index) 4,829,796 Ops/sec
Reflect.has() 3,945,001 Ops/sec
Array.indexOf 1,162,926 Ops/sec
Array includes 1,159,888 Ops/sec
Script Preparation code:
Tests: