let name = "Nick";
const tinyize = function (name) {
const myName = 'Tiny ' + name + '!';
return myName;
};
name = tinyize('Rick');
console.log(name);// Tiny Rick
for (let i = 0; i < 5; i++) {
setTimeout(function () {
console.log(i); // let = 0 let = 1, let = 2, let = 3, let = 4
}, 100);
}
console.log(i) //>>> THIS WILL create an ERROR, because LET is block scoped!! (vs Var that is instead scoped to the Lexical Feild).