[Beta Feedback] ES6: Confusing challenge description (Destructuring Assignment)

I think some of you are missing the point. In this particular challenge using destructuring assignment may have been overkill (and counter intuitive). But don’t let this one challenge sour you on destructuring assignment because knowing this is not optional.

@japickering It is not object literal notation. This is a way to extract properties from objects (and arrays) and assign them to local variables.

Consider this…

// this - much better
const {lastName : name, age , zipCode : zip} = clientList[currentRegion].clients[i];

// vs this - good 
const name = clientList[currentRegion].clients[i].lastName;
const age = clientList[currentRegion].clients[i].age;
const zip = clientList[currentRegion].clients[i].zipCode;

If you are going to be doing complex operations on this client list working with variable names like name is better than clientList[currentRegion].clients[i].lastName
Assigning all those in a sweet one-liner is WAY better

8 Likes