Created
June 16, 2019 10:47
-
-
Save smallpaes/3416e850a2440c7ae313b49a29c3c51e to your computer and use it in GitHub Desktop.
This file contains 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 lunch = 'Beef Noodle' | |
let dinner = 'Chicken Curry Rice' | |
let raining = true | |
if (raining) { | |
// 變數交換 | |
[dinner, lunch] = [lunch, dinner] | |
} | |
console.log(`${lunch} -> ${dinner}`) //Chicken Curry Rice -> Beef Noodle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment