← BYTES
JavaScript·Intermediate·Ref: 3.2.15
What does `Array.prototype.includes()` check for?
Have a question about this video? Mention reference 3.2.15 when you contact us.
a.Whether a given value is present anywhere among the array's elements
b.Whether a given index exists in the array
c.Whether the array is non-empty
d.Whether the array contains only strings
`arr.includes(value)` returns true/false based on whether that exact value (using SameValueZero comparison, which treats NaN as equal to itself, unlike ===) appears anywhere in the array -- a more readable alternative to `arr.indexOf(value) !== -1`.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES3215#JavaScript