Skip to content
Open
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
28 changes: 27 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
// Write your solution in this file!
const employee = {
name: 'Yuriy',
streetAddress: 'None of your business'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha

};

const updateEmployeeWithKeyAndValue = (employee, key, value) => {
return {
...employee,
[key]: value
};
}

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

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

const destructivelyDeleteFromEmployeeByKey = (employee, key) => {
delete employee[key];
return employee;
}