Test name | Executions per second |
---|---|
String.prototype.includes | 500115808.0 Ops/sec |
String.prototype.indexOf | 503111488.0 Ops/sec |
var str = '';
var i = 0;
while (i <= 1E5) str += i++;
str += 'end';
const item = str.includes('end');
const index = str.indexOf('end');