I need to delete an employee from an array. I need to remove the full object for that employee (all of the key value pairs) with a function that will loop through the array and check for the key value firstName and delete the object based on the name.
Lets say the name is "Mike".
I want to use the splice command and a for loop. this is what I have currently... but I can't get it to detect and delete the object. I just get the full list returned.
function employeeUpdater() {
for (let key in obj) {
if (obj[key] === "Theo") {
Array.splice();
}
}
return(obj)
}