1const fruits = ['apple', 'banana', 'mango', 'guava'];
2
3function checkAvailability(arr, val) {
4 return arr.some(function(arrVal) {
5 return val === arrVal;
6 });
7}
8
9checkAvailability(fruits, 'kela'); // false
10checkAvailability(fruits, 'banana'); // true
1[2, 5, 8, 1, 4].some(isBiggerThan10); // false
2[12, 5, 8, 1, 4].some(isBiggerThan10); // true
3
1const array = [1, 2, 3, 4, 5];
2
3// checks whether an element is even
4const even = (element) => element % 2 === 0;
5
6console.log(array.some(even));
7// expected output: true
8