JavaScript 2025 · Arrays
Check if an array contains a value
Return true if the value is in the array.
const found = [1, 2, 3].includes(2);
Official JavaScript 2025 documentation
JavaScript 2025 · Arrays
Return true if the value is in the array.
const found = [1, 2, 3].includes(2);
Official JavaScript 2025 documentation
Was this page helpful?