Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

freecodecamp 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; });

// With love @kouqhar
Source by www.linkedin.com #
 
PREVIOUS NEXT
Tagged: #freecodecamp #Drop
ADD COMMENT
Topic
Name
2+4 =