Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array#includes() vs. Set#has() vs. Object.hasOwn()
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Set#has()
219.9M/s
Object.hasOwn()
116.1M/s
Array#includes()
86.4M/s
View exact numbers
Test name
Executions per second
✓
Set#has()
219,870,448 Ops/sec
Object.hasOwn()
116,058,432 Ops/sec
Array#includes()
86,357,992 Ops/sec
Script Preparation code:
var arr = Array.from({ length: 10 }, (_, i) => i + 1); var a = [...arr]; var b = new Set(arr); var c = Object.fromEntries(arr.map((v) => [v, true]));
Tests:
Array#includes()
return a.includes(9)
Set#has()
return b.has(9)
Object.hasOwn()
return Object.hasOwn(c, '9')