I have a structure like the following:
skillet.person = { name: { first: '', last: '' }, age: { current: '' }, birthday: { day: '', month: '', year: '' } }
I was wondering how I would update these values ? i.e. I though the following was correct
skillet.person.name.push({ first: 'blah', last: 'ha'});
but it's wrong ? How can I fix this ?
Using ES7+ syntax and a functional approach:
const new_obj = { ...obj, name: { first: 'blah', last: 'ha'} }
2.1m questions
2.1m answers
60 comments
57.0k users