Last active
May 12, 2021 00:15
-
-
Save pjcodesjs/792f977986b2f98fae9c01fa7de7d0b8 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
// REGULAR WAY | |
let fav_num; | |
let fav_fruit = 'Apple'; | |
console.log(fav_num); // undefined | |
console.log(fav_fruit); // 'Apple' | |
// SHORTER WAY | |
let fav_num, fav_fruit = 'Banana'; | |
console.log(fav_num); // undefined | |
console.log(fav_fruit); // 'Banana' | |
// ASSIGNING MULTIPLE VALUES (LONGER WAY) | |
let older_bro, younger_bro; | |
older_bro = 'Dean'; | |
younger_bro = 'Sammie'; | |
console.log(older_bro, younger_bro); // Dean Sammie | |
// SHORTER WAY | |
let [older_bro, younger_bro] = ['Dean', 'Sammie']; | |
console.log(older_bro, younger_bro); // Dean Sammie |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment