Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
has vs includes vs convert
(version: 1)
Comparing performance of:
includes vs has vs convert to set then has
Created:
15 days ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = Array.from(100).fill().map((_, index) => index); var set = new Set(arr);
Tests:
includes
arr.includes(5);
has
set.has(5);
convert to set then has
new Set(arr).has(5)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
includes
has
convert to set then has
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
3 days ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Safari/605.1.15
Browser/OS:
Safari 26 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
includes
108144616.0 Ops/sec
has
480587904.0 Ops/sec
convert to set then has
68930264.0 Ops/sec
Comments
Confirm delete:
Do you really want to delete benchmark?