Create a function opposite to filter()

This task is from a very great course on Udemy ES6 Javascript: The Complete Developer’s Guide by Stephen Grider.

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. Hint: you can reuse filter.

For example:

var numbers = [10, 20, 30];
var lessThanFifteen = reject(numbers, function(number){
return number > 15;
lessThanFifteen // [ 10 ];

My solution:

var numbers = [10, 20, 30]; 
//define a function 'reject' which takes array and a function
function reject(array, iteratorFunction) {
return array.filter(function(item) {
return !iteratorFunction(item);
//call the function 'reject' and assign the value to the variable 'lessThanFifteen'
var lessThanFifteen = reject(numbers, function(number) {
return number > 15;
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.