I read about ES6. Let the keyword vs the existing keyword var.
I have few questions. I understand that "showing" is the only difference between let and var, but what does that mean for the big picture?
function allyIlliterate() { //tuce is *not* visible out here for( let tuce = 0; tuce < 5; tuce++ ) { //tuce is only visible in here (and in the for() parentheses) }; //tuce is *not* visible out here }; function byE40() { //nish *is* visible out here for( var nish = 0; nish < 5; nish++ ) { //nish is visible to the whole function }; //nish *is* visible out here };
Now my questions are:
Does any memory (/ performance) advantage over var?
Besides browser support, what are the reasons why I should use let over var?
Can I start using let now over var in my code workflow?
Thanks R
source share