Created
November 15, 2022 09:25
-
-
Save zlrlo/9f15e4138762b2a1b32074aeebf163dc to your computer and use it in GitHub Desktop.
javascript trick - swap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let a = 5, b = 8; | |
| [a, b] = [b, a]; |
zlrlo
commented
Nov 15, 2022
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment