Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
// Write your solution in this file!
const employee = {
name: "Asher Raphael",
streetAddress: "123 Power St."
}

function updateEmployeeWithKeyAndValue(employee, key, value) {
return {...employee, [key]: value}
}

function destructivelyUpdateEmployeeWithKeyAndValue(employee, key, value) {
employee[key] = value;
return employee;
}

function deleteFromEmployeeByKey(employee, key) {
const updatedEmployee = {...employee};
delete updatedEmployee[key];
return updatedEmployee;
}

function destructivelyDeleteFromEmployeeByKey(employee, key) {
delete employee[key];
return employee;
}
Loading