“JavaScript in Array” Code-Antworten

in Array in JS

var letters = ["A", "B", "C", "D"];

var result = letters.includes("A");
// result will be TRUE or FALSE
Terrible Tern

JavaScript Array enthält

var colors = ["red", "blue", "green"];
var hasRed = colors.includes("red"); //true
var hasYellow = colors.includes("yellow"); //false
Grepper

So überprüfen Sie, ob sich das Element in der Liste JS befindet

var myList=["a", "b", "c"];
mylist.includes("d")//returns true or false
Combative Centipede

JavaScript -Element im Array

var fruits = ["Banana", "Orange", "Apple", "Mango"];

var n = fruits.includes("Mango");
Brave Bear

Die JavaScript -Liste umfasst

const array1 = [1, 2, 3];

console.log(array1.includes(2));
// expected output: true

const pets = ['cat', 'dog', 'bat'];

console.log(pets.includes('cat'));
// expected output: true

console.log(pets.includes('at'));
// expected output: false
Determined Deer

JavaScript in Array

how to use innerHTML
Gentle Gerbil

Ähnliche Antworten wie “JavaScript in Array”

Fragen ähnlich wie “JavaScript in Array”

Weitere verwandte Antworten zu “JavaScript in Array” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen