Home
Topics
Practice
Roadmap
DSA Tracker
Code Editor
Tech Blogs
More
Sign in
Get started
Loading question...
Feedback
Destructuring Assignment
Easy
00:00
0 users online
Share
Description
Solution
Submissions
Discussion
Use destructuring to extract values from objects and arrays.
Sample Input:
{name: "John", age: 30}
Sample Output:
["John", 30]
Hints
Hint 1
Use object destructuring: const {name, age} = obj
Hint 2
Extract the properties you need
Hint 3
Return them as an array
Code Editor
Reset
Run
Save
Loading...