how to add 2cdelete 2cupdate property in javascript object

Solutions on MaxInterview for how to add 2cdelete 2cupdate property in javascript object by the best coders in the world

showing results for - "how to add 2cdelete 2cupdate property in javascript object"
Marta
03 May 2019
1var brooklynNineNine = {
2  name: 'Raymond Holt',
3  currentRole: 'Captian of brooklyn99',
4}
5brooklynNineNine.husband = 'Kevin' // Or brooklynNineNine['husband'] = 'Kevin'
6
7var list =
8{
9  name: 'Michael Scott',
10  company: 'Dunder Mufflin',
11  designation: 'Regional Manager',
12  show: 'The Office',
13},
14  new_obj = { ...list, partner: 'Holly Flax' }
15
16var brooklynNineNine = {
17  name: 'Amy Santiago',
18  currentRole: 'Detective brooklyn99',
19  husband: 'Jake Peralta',
20  mentor: 'Raymond Holt'
21}
22
23delete brooklynNineNine.mentor;
24
25var favChar = {
26  name: 'Michael Scott',
27  company: 'Dunder Mufflin',
28  designation: 'Regional Manager',
29  show: 'The Office'
30}
31
32favChar.designation = 'Hero of Threat Level Midnight'