Answers for "JavaScript Array Methods includes()"

74

javascript array contains

var colors = ["red", "blue", "green"];
var hasRed = colors.includes("red"); //true
var hasYellow = colors.includes("yellow"); //false
Posted by: Guest on October-19-2019
8

javascript array contains

var fruits = ["Banana", "Orange", "Apple", "Mango"];
var n = fruits.includes("Mango");
Posted by: Guest on October-19-2019
1

JavaScript Array Methods includes()

const list = [1, 2, 3, 4, 5, 5, 23, 21, 1231, 2434, 443546456, 17];
console.log(list.includes(4));
// --> true
Posted by: Guest on May-07-2021

Code answers related to "JavaScript Array Methods includes()"

Code answers related to "Javascript"

Browse Popular Code Answers by Language