Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object.hasOwnProperty vs Object in vs Object[] vs Array.indexOf vs Array.includes
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/135.0.7049.53 Mobile/15E148 Safari/604.1
Browser:
Chrome Mobile iOS 135
Operating system:
iOS 18.3.1
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
Object.hasOwnProperty
38618092.0 Ops/sec
Object in
37659524.0 Ops/sec
Array.indexOf
876894.7 Ops/sec
direct
36408168.0 Ops/sec
Array includes
295813.6 Ops/sec
Script Preparation code:
var object = {}, array = [], i, test = 1000; for (i = 0; i < 1000; i++) { object['something' + i] = true; array.push('something' + i); }
Tests:
Object.hasOwnProperty
object.hasOwnProperty('something' + test)
Object in
('something' + test) in object
Array.indexOf
array.indexOf('something' + test) !== -1
direct
object['something' + test] === true
Array includes
array.includes('something' + test)