Course · Section 2: JavaScript Fundamentals – Part 1 · Lecture 11: Data Types
Implement `swap(a, b)` returning the two arguments as an array in reversed order `[b, a]`.
+ 1 hidden test run on Submit.
Returning [b, a] is the array-destructuring swap idiom, no temporary variable needed.
Run your code to see results.