odin-default-js-exercises/04_removeFromArray/removeFromArray.js

9 lines
190 B
JavaScript

const removeFromArray = function(...args) {
const array = args[0];
return array .filter( val => !args.includes(val));
};
// Do not edit below this line
module.exports = removeFromArray;