Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js check if array contains value

var arr = ["name", "id"];
  if (arr.indexOf("name") > -1) console.log('yeah');
  else console.log('nah');
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #js #check #array
ADD COMMENT
Topic
Name
4+7 =