Hello everyone, Can someone tell me how to choose the index of the element inside the array, by using destructuring assignment to assign variables from arrays.
Your code so far
const myBirthYear = 2005;
const myBirthMonthAndDay = [0, 7, 27];
const myBirthDate = [myBirthYear,, myBirthMonthAndDay];
Challenge: ES6 - Use Destructuring Assignment to Assign Variables from Arrays
Link to the challenge:
try :
const myBirthDate = [myBirthYear,, ...myBirthMonthAndDay];
- This is an example based on your code provided in the post:
The date gotten here is 7 1 2005.
- A variation (with a slightly different result look) could look like this:
P.S.
This problem is not connected to the challenge you have posted a link to. Please, stick to the course challenges. Post your private code and issues you have encountered under the ‘general’ category.