diff --git a/index.js b/index.js index fccc9e603..404d43382 100644 --- a/index.js +++ b/index.js @@ -1 +1,23 @@ -// Write your solution in this file! +const employee = { + name: "Nihar", + streetAddress: "300 Pickwick Dr.", +}; +function updateEmployeeWithKeyAndValue(employee, key, value){ + return { + ...employee, + [key]: value + }; +} +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 +}