Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ES6 const and block scoping
- const myFavouritePie = 'Apple';
- console.log(myFavouritePie) // Apple
- {
- // having trouble to think of any pie except apple
- myFavouritePie = 'Chicken'; // Uncaught TypeError: Identifier 'cake' has already been declared
- }
- // Gotcha
- const myFridgeContents = {
- milk: 1,
- applePie: 23
- };
- myFridgeContents.applePie = 22; // this is valid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement