set has vs regex vs in check vs hasOwnPropertyFastest: set has (27.9x faster)
178,231,744 ops/sec
164,180,256 ops/sec
38,086,444 ops/sec
6,384,460 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| set has | |
| regex | |
| in check | |
| hasOwnProperty |
| Test name | Executions per second |
|---|---|
| ✓ in check | 233,684,432 Ops/sec |
| set has | 192,848,624 Ops/sec |
| regex | 47,224,812 Ops/sec |
| hasOwnProperty | 7,907,017 Ops/sec |