check whether an array includes a particular value or not in JavaScript

JavaScript
3
var arr = [1, 2, 3, 4, 5];
var check = arr.includes(3);
console.log(check);
🤖 Code Explanation
The code checks to see if the value 3 is included in the array. If it is, it returns true. Otherwise, it returns false.

More problems solved in JavaScript




















