Code solution improvement for a ES6 lesson

Concerning this lesson:

This code is working and it does use array destructuring to swap a and b, but it doesn’t qualify as a solution:
let arr = [a, b];
[b, a] = arr;

The code which is considered as a solution is:
[b, a] = [a, b];

I think both should be valid.

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