Use Destructuring Assignment to Assign Variables from Objects

Hi

While the solution is fairly easy the instructions are a little baffling. You are not alone in being confused by the challenge.

What they want is for you to assign the length property of str to a local variable len using destructuring assignment, all on one line.

This is their example that pertains to the challenge solution

const { x : a, y : b, z : c } = voxel // a = 3.6, b = 7.4, c = 6.54

//property x of voxel is assigned to local variable a

so you need to do
property length of str is assigned to local variable len

8 Likes