Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How do I check if an array includes a value in JavaScript?

Modern browsers have Array#includes, which does exactly that and is widely supported by everyone except IE:

console.log(['joe', 'jane', 'mary'].includes('jane')); //true
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #I #check #array #includes
ADD COMMENT
Topic
Name
6+8 =