How to check if JavaScript array contains a specific value

Given a JavaScript array, how can I check whether it contains a specific item?

useincludes()Methods on array instances.

E.g:

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

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

Download mine for freeJavaScript beginner's manual


More js tutorials: