mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
remove class based exercises
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user