Quotes help make search much faster. Example: "Practice Makes Perfect"

Saturday, May 13, 2017

FreeCodeCamp Drop It Sample Solution


function dropElements(arr, func) {
  // Drop them elements.
  for(var i=0; i<arr.length; i++){
    if([arr[i]].filter(func)>0){
      return arr.slice(i,arr.length);
    }
  }
  return [];
}

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

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts