Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript array contains

var colors = ["red", "blue", "green"];
var hasRed = colors.includes("red"); //true
var hasYellow = colors.includes("yellow"); //false
 
PREVIOUS NEXT
Tagged: #javascript #array
ADD COMMENT
Topic
Name
6+7 =