is in list
by thewolff
JavaScript
const arr = [3,5,'boo']
const isInList = (el, list) => {
if(Array.isArray(list)) {
return list.includes(el);
}
}
console.log(isInList('boo', arr))
by thewolff
const arr = [3,5,'boo']
const isInList = (el, list) => {
if(Array.isArray(list)) {
return list.includes(el);
}
}
console.log(isInList('boo', arr))