added answers
This commit is contained in:
parent
f529df4e26
commit
5b8f2c93c8
|
@ -1,13 +1,8 @@
|
||||||
const removeFromArray = function(arr, remove) {
|
const removeFromArray = function(...args) {
|
||||||
if(arr.includes(remove)){
|
const array = args[0];
|
||||||
let removedValue = arr.splice(arr[remove] - 2, 1);
|
return array .filter( val => !args.includes(val));
|
||||||
let clean = arr.filter(( para ) => {
|
};
|
||||||
return para != removedValue;
|
|
||||||
});
|
|
||||||
return clean;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log(removeFromArray([1,2,3,4], 3));
|
|
||||||
// Do not edit below this line
|
// Do not edit below this line
|
||||||
module.exports = removeFromArray;
|
module.exports = removeFromArray;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue