Hi,
my name is Madina and I'm trying to transition into junior developer role.
I started my journey long time ago. I paused, took breaks, questioned my life choices and current state is that I'm doing an online bootcamp (65% done) ✅
I did all the courses on JS, which you can only imagine, any format: YouTube tutorials, blogs, courses paid & free...
It took me 3 years to grasp on the concept of Destructuring in JS. I just couldn’t get it. Now I can tell that I finally understood it)
Given an object
let person = {
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}
I don’t want the whole object, just some parts of it:
const { userId, title } = person;
So, Destructuring is a way of cutting pieces of a cake 🎂 🍰
let cake = { 🎂 }
Results in
let { 🍰 } = 🎂
I hope it could help someone out there!
Top comments (0)