📜  放下它 - Javascript 代码示例

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

代码示例1
const dropElements = (arr, func) => {
  const indexes = arr.findIndex(func);
  return indexes >= 0 ? arr.slice(indexes) : []
}

dropElements([1, 2, 3], function(n) {return n < 3; });