Created
September 11, 2018 17:03
-
-
Save rafagarcia/c6c0071c1dc193e468ba6138860a081a to your computer and use it in GitHub Desktop.
// source http://jsbin.com
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
// Array destructuring. Swap values | |
let param1 = 1; | |
let param2 = 2; | |
//swap and assign param1 & param2 each others values | |
[param1, param2] = [param2, param1]; | |
console.log(param1); // 2 | |
console.log(param2); // 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment