Answers for "JS, indexOf();"

0

JS, indexOf();

function quickCheck(arr, elem) {
  return arr.indexOf(elem) != -1;
}
console.log(quickCheck(["squash", "onions", "shallots"], "mushrooms"));
Posted by: Guest on May-26-2021

Browse Popular Code Answers by Language