Learning JavaScript? Download my free JavaScript Handbook 🔥

Use the includes() method on the array instance.

For example:

['red', 'green'].includes('red') //true ✅

['red', 'green'].includes('yellow') //false ❌

Found a typo or problem? Edit this page