📜  javascript代码示例中的indexof是什么

📅  最后修改于: 2022-03-11 15:03:57.878000             🧑  作者: Mango

代码示例6
function quickCheck(arr, elem) {
  return arr.indexOf(elem) != -1;
}
console.log(quickCheck(["squash", "onions", "shallots"], "mushrooms"));