Answers for "Drop it"

0

Drop it

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

dropElements([1, 2, 3], function(n) {return n < 3; });
Posted by: Guest on February-26-2021

Code answers related to "Drop it"

Code answers related to "Javascript"

Browse Popular Code Answers by Language