remove class based exercises

This commit is contained in:
Cody Loyd
2017-11-20 13:51:01 -06:00
parent f0bf584e59
commit 290e7f1da4
18 changed files with 67 additions and 164 deletions
+10 -2
View File
@@ -1,5 +1,13 @@
var removeFromArray = function() {
var removeFromArray = function(array) {
elementsToRemove = [...arguments]
elementsToRemove.splice(0,1)
elementsToRemove.forEach(element => {
let index = array.indexOf(element)
if (index > -1) {
array.splice(index, 1)
}
})
return array
}
module.exports = removeFromArray