-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
22 lines (16 loc) · 594 Bytes
/
Copy pathindex.js
File metadata and controls
22 lines (16 loc) · 594 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Write your solution in this file!
const employee = {
name: "Sam",
streetAddress: "11 Broadway",
};
let updateEmployeeWithKeyAndValue = (employee, key, value) => Object.assign({}, employee, { [key]: value })
let destructivelyUpdateEmployeeWithKeyAndValue = (employee, key, value) => { employee[key] = value; return employee; }
let deleteFromEmployeeByKey = (employee, key) => {
const newEmployee = Object.assign({}, employee);
delete newEmployee[key];
return newEmployee;
}
let destructivelyDeleteFromEmployeeByKey = (employee, key) => {
delete employee[key];
return employee;
}