Destructure and Swap

ES6+ ยท easy

Implement `swap(pair)` that takes a two-element array `[a, b]` and returns `[b, a]` using destructuring.

Hints
  • Destructure the array into two variables, then return them swapped.
Loading...

Run your code to see results.