Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
includes vs has
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Browser:
Chrome 129
Operating system:
Linux
Device Platform:
Desktop
Date tested:
10 months ago
Test name
Executions per second
includes
40222540.0 Ops/sec
has
14591688.0 Ops/sec
Tests:
includes
const array = [1, 2, 3]; const hasValue = value => array.includes(value); hasValue(1); hasValue(2); hasValue(3);
has
const set = new Set([1, 2, 3]); const hasValue = value => set.has(value); hasValue(1); hasValue(2); hasValue(3);