I dont know why it cant pass result..The console shows that its solved but when I try to pass it refuses to pass it

Tell us what’s happening:
Describe your issue in detail here.

Your code so far


let a = 8, b = 6;

// Only change code below this line

{ [,,,,,a,,b] =[1,2,3,4,5,6,7,8]};
console.log(a,b)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36.

Challenge: Use Destructuring Assignment to Assign Variables from Arrays

Link to the challenge:

You need to swap the values of a and b, not set a and b to what you happen to know the other contains. Your code should work even when you don’t know what values are set on this line

Thank you Jeremy , I just solved it.

I just tried what you meant by my code should work even I don’t know what values are set.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.