Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Chrome 119
Mac OS X 10.15.7
Desktop
2 years ago
Benchmark.js
Set.has non-Existing
7.3M/s
Set.has existing
7.3M/s
Array.find existing
3.5M/s
Array.find non-existing
2.0M/s
View exact numbers
Test name Executions per second
Set.has non-Existing 7,272,984 Ops/sec
Set.has existing 7,270,051 Ops/sec
Array.find existing 3,536,888 Ops/sec
Array.find non-existing 1,991,065 Ops/sec
Script Preparation code:
Tests: