Array Includes or Set Has: Which Is Faster?
Array.includes is the tool everyone reaches for. Set.has sits one refactor away and is almost never used. I benchmarked both with a real run in Node.js 22, and the gap is not subtle. Full run in this Short: https://youtu.be/r2CVLAdLe5U The test A list of 100,000 items, and 1,000 lookups for values…
Read the full story at DEV Community — AI ↗
Timeline · 1 report
- 2026-12-04 03:35 · DEV Community — AI
Array Includes or Set Has: Which Is Faster?