Added html file to debug in browser console
This commit is contained in:
parent
88fc7f3aed
commit
d13b907660
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<script src="removeFromArray.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
|
@ -1,5 +1,22 @@
|
||||||
const removeFromArray = function() {
|
const removeFromArray = function(array) {
|
||||||
|
const removalChecks = [];
|
||||||
|
for (i=0; i<arguments.length; ++i) {
|
||||||
|
if (i !== 0) {
|
||||||
|
removalChecks.push(arguments[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(removalChecks)
|
||||||
|
lenArray = array.length-1;
|
||||||
|
for (i=0; i<removalChecks.length; i++) {
|
||||||
|
valToCheck = removalChecks[i]
|
||||||
|
for (i=lenArray; i>=0; --i) {
|
||||||
|
if (array[i] == valToCheck) {
|
||||||
|
array.splice(i, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return array
|
||||||
};
|
};
|
||||||
|
|
||||||
// Do not edit below this line
|
// Do not edit below this line
|
||||||
|
|
Loading…
Reference in New Issue