To check if an array includes a value in JavaScript, we use the includes
method.
For instance, we write
console.log(["joe", "jane", "mary"].includes("jane"));
to call includes
to check if 'jane'
is in the ["joe", "jane", "mary"]
array.
Since 'jane'
is in the array, true
is returned.