Course · Section 9: Data Structures, Modern Operators and Strings · Lecture 111: The Spread Operator (...)
Implement `swap(pair)` that takes a two-element array `[a, b]` and returns `[b, a]` using destructuring.
+ 1 hidden test run on Submit.
Returning the reversed pair is the destructuring swap idiom.
Run your code to see results.