Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
string includes vs foreach (split)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
string includes
10423830.0 Ops/sec
string foreach (split)
4444236.5 Ops/sec
Script Preparation code:
var arr1 = "string 1234" var arr2 = ["A","B","C","D","a","b","c"]
Tests:
string includes
arr2.map(x => { if (arr1.includes(x)) x.disabled = true; return x; });
string foreach (split)
arr2.map(x => { arr1.split("").forEach(y => { if (x.value === y) x.disabled = true; }); return x; });