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