javascript is in list code example
Example 1: 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.
Example 2: is value in list javascript
function inListBoolean(list, item){
var boolean = false
list.forEach(value => {
if(value == item){
boolean = true
}
})
return boolean;
}