Answers for "Check For The Presence of an Element With indexOf()"

0

Check For The Presence of an Element With indexOf()

function quickCheck(arr, elem) {
  return arr.indexOf(elem) >= 0 ? true : false;
}
console.log(quickCheck(["squash", "onions", "shallots"], "mushrooms"));
Posted by: Guest on April-21-2021

Code answers related to "Check For The Presence of an Element With indexOf()"

Browse Popular Code Answers by Language