diff --git a/index.js b/index.js index fccc9e603..c5aef6863 100644 --- a/index.js +++ b/index.js @@ -1 +1,24 @@ -// Write your solution in this file! +const employee = { + name: "Lumpy", + streetAddress: "104 Pancoast Ave", +}; + +function updateEmployeeWithKeyAndValue(employee, key, value) { + return {...employee, [key]: value,}; +} + +function destructivelyUpdateEmployeeWithKeyAndValue(employee, key, value) { + employee[key] = value; + return employee; +} + +function destructivelyDeleteFromEmployeeByKey(employee, key) { + delete employee[key]; + return employee; +} + +function deleteFromEmployeeByKey(employee, key) { + const newEmployee = {...employee}; + delete newEmployee[key]; + return newEmployee; +}