30-Days-Of-JavaScript icon indicating copy to clipboard operation
30-Days-Of-JavaScript copied to clipboard

Day 11 Exercise Level 3 4th question

Open ChintalapudiSaiNitishKumar opened this issue 2 years ago • 3 comments

How to add new property in Nested Array of Object using destructuring. Help me with this problem.

can you please explain me little bit more about your problem. so i can help you?

mmashare avatar Jun 03 '22 12:06 mmashare

There is a key called "skills" and inside that an array called "frontend" inside that array how to add key value pair inside array by creating new object by using only destructuring ,in that problem he added new "skill" and "level" as key value pair , is there any syntax to add what I have mentioned using destructuring or not ?

Hello Chin, You can try something like: let addSkill = student.skills.frontEnd.push({skill: 'BootStrap', level: 8}) This way you can push any objects into an array. Hope it helps!

suvrat23 avatar Sep 16 '22 03:09 suvrat23