Created
January 1, 2017 20:54
-
-
Save mannuelf/88ed7c8e78f2dfcef424059f745ee69f to your computer and use it in GitHub Desktop.
Create a function called 'reject'. Reject should work in the opposite way of 'filter' - if a function returns 'true', the item should *not* be included in the new array.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const numbers = [ 10, 20, 30, 40, 50, 60 ]; | |
function reject(numbers, iteratorFunction) { | |
return numbers.filter(function(number){ | |
return (number < 15); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment