It does what you'd expect in JavaScript and this has this example:
var array1 = [1, 2, 3];
console.log(array1.includes(2));
var pets = ['cat', 'dog', 'bat'];
console.log(pets.includes('cat'));
console.log(pets.includes('at'));
This is going to log to the console:
- true
- true
- false
No comments:
Post a Comment