search no of item in array code example
Example 1: search no of item in array
let alligator = ["thickscales", "tail", "rounded","12"];
console.log(alligator.length)
Example 2: how to get the index of an array in javascript
search = (arr, item) => { return arr.indexOf(item); }
Example 3: check items in array javascript
function checkAllEven(arr) {
return arr.every(function(x){
return x % 2 === 0
})
}
//using "every" to check every item in array.