Problems

Destructure and Swap

EasyES6+ Features

Read two values separated by a space and print them swapped (still space-separated). Solve it with array destructuring — no temp variable.

Input: one line: a b. Output: b a.

Your program reads from stdin and prints to stdout.

Example 1

Input: 1 2

Output: 2 1

Hints

JavaScriptES6Destructuring
Destructure and Swap | CodeForge AI