Variable Scope in JavaScript

preview_player
Показать описание
Learn the nuances of variable scoping in JavaScript by looking at various examples using 'var', 'let', and other techniques.
Рекомендации по теме
Комментарии
Автор

Your presentation is awesome and slides also are awesome

qazimrama
Автор

The "variable hoisting" is something new for me. Thanks for the awesome explanation!

rahenrique
Автор

I was just starting to drift from the "variables at the top" best practice because I didn't really understand hoisting. Now I understand it and why the variables at the top thing is a best practice. Thanks Kirupa. Glad to see you're making high quality tutorials (I used to be on your forums back when @pasql was still DarkMotion -- several years ago). Happy I stumbled upon this channel and your site again!

CoryTheSimmons
Автор

You are really good. You deserve higher views.

LightWillSine
Автор

Yeah, it's one of those things that you learn the hard way when you are scratching your head over why your code isn't working haha.

kirupa
Автор

I should have never watched this while stoned.

shabba
Автор

all the explication is fine but how do I expose the variable after being use to the global holding the new value ?

intuneknight
Автор

var days=['jan', 'feb', 'mar']
for(var i=0;i<days.length;i++)
{
const ele=days[i];/*how it is executed I am confused about constant bcoZ const cannot be reassigned */
console.log(ele);
}
thank u sir

parvezmd
Автор

Looks like you are reading from the monitor but its good tutorial

sudhiraayyagary