Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Chrome 119
Windows
Desktop
2 years ago
Benchmark.js
Array.prototype.includes()
5.4M/s
Array.prototype.indexOf()
5.4M/s
RegExp.prototype.test()
308K/s
View exact numbers
Test name Executions per second
Array.prototype.includes() 5,442,840 Ops/sec
Array.prototype.indexOf() 5,417,848 Ops/sec
RegExp.prototype.test() 307,581 Ops/sec
Script Preparation code:
Tests: