Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Mac OS X 10.15.7
Desktop
2 years ago
Benchmark.js
Set.has existing
4.1M/s
Set.has non-Existing
4.0M/s
Array.find existing
2.0M/s
Array.find non-existing
1.2M/s
View exact numbers
Test name Executions per second
Set.has existing 4,114,897 Ops/sec
Set.has non-Existing 3,976,165 Ops/sec
Array.find existing 2,045,721 Ops/sec
Array.find non-existing 1,151,168 Ops/sec
Script Preparation code:
Tests: