Day 28 - ES6 pt.2
by Nino · 6 things on Twos
- ES6 Variables and Scope
- const variables can't be changed, instead use array methods to update it's contents
// .push & .pop
- const NEW_PRESENT = "Trousers";
const WARDROBE = ["Shirt"];
WARDROBE.push(NEW_PRESENT);
console.log(WARDROBE);
> [ 'Shirt', 'Trousers' ]
- ---
- "Scope" is a term used to indicate where variables are available. There are parts of our code where we don't have access to them.
- relearn exercise 2