All done
This commit is contained in:
parent
1987591d9f
commit
f2ff635fcf
|
@ -7,7 +7,7 @@ const removeFromArray = function(...args) {
|
||||||
// Remove all the remaining elements from the array
|
// Remove all the remaining elements from the array
|
||||||
for (let i = 1; i < args.length; i++) {
|
for (let i = 1; i < args.length; i++) {
|
||||||
pos = myArray.indexOf(args[i]);
|
pos = myArray.indexOf(args[i]);
|
||||||
if (pos >= 0 && myArray[pos] === args[i]) { //Is it a valid argument
|
if (pos >= 0 && myArray[pos] === args[i]) { //Check argument and type
|
||||||
myArray.splice(pos, 1);
|
myArray.splice(pos, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue