This doesn't have to be re-done as you said in the video, this is nice honestly, there are so many boring programming videos on the web that the enthusiasm really helps, similar feelings to CodeCourse :) Keep it up man, 10/10
By playing around with var and let I kind of got the idea of how it worked but once you explained that "hoisting" term, things really got clear and I remembered what my high school programming teacher used to say regarding C++ and Pascal: "If you're going to declare something, do it at the top of the file!". That really clicked in my brain once you explained what hoisting was :D Keep up the good work bro. You're killing it!
Wow, amazing! Your explanation style is so verbose (in a good sense) that I can just listen to many of the videos, while doing chores and stuff, and understand the ideas being presented. Simply marvelous!
This is actually very informative AND entertaining/funny. That is unique, not many have this talent. Makes learning much easier for people like me! Thanks!
I am learning JS on free code camp now and you explain things so well its surprising easy for me to fill out challenges. thanks a lot and please keep making more videos! its a shame that i havent found your channel earlier
Crystal clear explanation of the difference, thanks a lot! ♥ I've been using var all my life (more like for the few months ago), thinking that the variable is limited to its block like C++ and Java, after watching this, I was like what!
Awesome video! Thanks, now I'll use "let" as well, because I'm used to think about "block scope" and not "function". Very interesting stuff, thanks a lot!
You are magnificent, and the way you made your videos is unbelievable fantastic, I have not seen anyone pro or regular who made such good videos that are pleasant to watch like you did, like if I'm sitting in a great school, Thank you a million for your great way of explaining and for those wonderful great videos that made learning fun.
That was actually super helpful. I'm graduating from Google Apps Script to real Javascript and doing some game and graphics coding for the first time, and this explained > 25% of the language barrier I was encountering.
Great video, i just started coding, in JS coming from a background in C++, and and i mostly learned to code JS from mini bootcamp that used ES6 and now i am going back and doing intro courses, and a lot of them use var and stuff and write in in concatenated strings over just using a template string, i much prefer the ES6 stuff and i am glad i learned it first.
thank you so so much. you started using let a while back and I asked my qualified friend to explain why and it didn't make sense other than they had different use cases... der. after listening to this video it makes absolute sense and i will 100% be using let for, at least, my for loops. your videos are my biggest inspiration and I am just so glad that through whatever round about way, you are able to explain to me at least how all these abstract things work.
Hoisting and Nested loops is an nightmare for many people I think , you are an excellent teacher , your way of learning us is fantastic , the class table's explanation is the key to success , many greetings my friend !!
The first time I've watched a video from this channel I was thinking "what is wrong with that guy?". After the ending of the first video I've realized how good Dan's explanations are. Since then I'm following his videos and enjoying the way of braking difficult concepts into small pieces. I've learned a lot about JS and found answers of a lot of questions I've asked myself. Keep going, man! 10x for creating this amazing channel and being a person you are! Greetings from Bonn, Germany.
This is really interesting. I had thought that it was some kind of optimization around declaring constants and variables that could change as functional programming became more fashionable. Thanks.
great video. I didn't even know what block scope or function scope was, just knew it was different and tricky. Now I know. thank you so much. Subscribed! looking forward to more of your videos :-)
This might sound like an odd question, but why can't I find this playlist on the Coding Train main RUclips site? In fact, there are a few tutorial series that I can't seem to directly, including the p5 Sound one. Am I missing something?
Tried the first part in p5.js editor, if I correct to console.log(x) then let x; followed by the rest, it results in the same error as let x =100; . I assume that they have updated it so that you can no longer call a variable before defining it with let.
Thanks so much for this. I had been wondering and had been meaning to find out at some point but your examples were superb to effectively demonstrate the difference. Amusingly I'd never realised that "for (int i = etc" in C++ only had i in scope inside the loop. I mean it makes sense but I was never consciously aware of it. I guess I rarely tried to re-use the counter outside of the loop, or if I did, I guess I must have fixed it on auto-pilot without really thinking about it properly.
Very well explained. I am starting out with Javascript so a good piece of timing for me. Ive also looked at your video on Genetic Algorithms in P5.js. If viewers have not seen that its well worth a look. If you have a pdf of that video I would buy it. Keep up the good work
Awesome, thank you! Best explanation for this that i've read/watched. Sidenote: when i was running the example where 100 was expected, i was getting undefined. I needed to run setup() after, so that part stumped me for a bit. function setup() { for (var i = 0; i < 100; i++); } console.log(i); } setup() // ;)
I need some help on node loop want to print n elements from the array after 10 seconds till complete array in a node so which is a better way ex: array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] print: 1 2 sleep 10 sec 3 4 sleep 10 sec . . 9 10 in this way
You present in a very entertaining way. One thing you missed was lexical scope with let vs var. Think setInterval method. I tripped up an interviewer on this when they were looking for a closure answer. subscribed
can you explain me why "let" variables will never create a property in the global/window object say: let x = 100; console.log(window.x); // undefined and can you explain me between a function declaration and a variable declaration which gets hoisted first function x() {} var x;
Hello, very interesting video considering all the new frameworks of javascript and the popularity that it has gained ( React js etc.). Do you plan making a video about immutable js?
"let" is a keyword frequently seen in functional programming languages, which JS is slowly inching closer to becoming at least a language that allows for fully functional code.
i learned programming & javascript thanks of you Dan because i wanted to do generativ art, now i'm a web developer it's my full time job, thank you :)
Would you mind telling me how long it took? I am learning as well.
@@khw9082 if you practice daily it would take only 1-1.15 months to master JS (only);
@@r_u_p_d9776 thanks a lot
@@khw9082 no problem buddy.
@@khw9082 lol this is not true. Even javascript developers with 5 years experience have not mastered Javascript
"A variable should have the smallest scope that is needed." I like that.
European concortium of mango loving astronauts, sounds reasonable xD
Lmao
Mangonauts!
😆
When I'm down I watch Coding train videos and the sun shines again :) Thanks for being such an awesome human being and teacher!
Love your stuff, Dan! You're becoming my go-to resource, whenever I'm confused about a concept. Keep up the good work!
This doesn't have to be re-done as you said in the video, this is nice honestly, there are so many boring programming videos on the web that the enthusiasm really helps, similar feelings to CodeCourse :)
Keep it up man, 10/10
By playing around with var and let I kind of got the idea of how it worked but once you explained that "hoisting" term, things really got clear and I remembered what my high school programming teacher used to say regarding C++ and Pascal: "If you're going to declare something, do it at the top of the file!".
That really clicked in my brain once you explained what hoisting was :D
Keep up the good work bro. You're killing it!
this was perfectly explained, love the energy!
Awesome video -- your breakdown of the differences between var and let was perfect. I love the energy too. Thanks!
Awesome video - very clearly defined the diff between var and let !!
Thank you!
Wow, amazing! Your explanation style is so verbose (in a good sense) that I can just listen to many of the videos, while doing chores and stuff, and understand the ideas being presented. Simply marvelous!
Yeah I do that
This is actually very informative AND entertaining/funny. That is unique, not many have this talent. Makes learning much easier for people like me! Thanks!
man you are funny and also explaining in good detail at same time. i love this kind of presentation.
thank you.
best video out there explaining let vs. var!
This guy made me love programming through his lessons
thanks man !
This was a great video !! This had me confused for a loooong time !
Wow..this is excellent stuff..i have been wracking my head over let vs var for a while and I finally get it!
ECMAScript === European Computer Manufacturers Association Script
I think that'd be single equal since triple equal will compare those two and will return false :P
Right, but, did you see that decorator '
Fair enough!
Thank you
I dont know. It looks like dickbutt to me
Very entertaining explanation. Thanks!
Exactly the same issue I have with scope, I learned how to program with Java and think in the same fashion. You are a great teacher! Thank you
Love the way you simply even the most complex topics!!
Not boring at all! Love your lessons!
That was a very nice explanation!!
Thank you! This is exactly what I was looking for and very well explained.
I reaaaaaallly like your videos and teaching style. Keep on keeping on!
He is the one of the best presenter i have seen in my life.
Interesting JavaScript tutorial..this is the best video I got till now about the differences between var and let..
YES! promises and promises chaining PLEASE!
I am learning JS on free code camp now and you explain things so well its surprising easy for me to fill out challenges. thanks a lot and please keep making more videos! its a shame that i havent found your channel earlier
Crystal clear explanation of the difference, thanks a lot! ♥
I've been using var all my life (more like for the few months ago), thinking that the variable is limited to its block like C++ and Java, after watching this, I was like what!
Awesome video! Thanks, now I'll use "let" as well, because I'm used to think about "block scope" and not "function". Very interesting stuff, thanks a lot!
You are magnificent, and the way you made your videos is unbelievable fantastic, I have not seen anyone pro or regular who made such good videos that are pleasant to watch like you did, like if I'm sitting in a great school, Thank you a million for your great way of explaining and for those wonderful great videos that made learning fun.
Love your videos and explanations of topics so everyone can understand :)
Amazing video, would have saved me thousands of lines of code if i had informed myself about let before ^^
Yaay, i got a heart :D
That was actually super helpful. I'm graduating from Google Apps Script to real Javascript and doing some game and graphics coding for the first time, and this explained > 25% of the language barrier I was encountering.
Great video, i just started coding, in JS coming from a background in C++, and and i mostly learned to code JS from mini bootcamp that used ES6 and now i am going back and doing intro courses, and a lot of them use var and stuff and write in in concatenated strings over just using a template string, i much prefer the ES6 stuff and i am glad i learned it first.
Happy teachers day Dan,😘😘,,, You're the best teacher I've ever seen... And You're attitude towards teaching is just Awesome 😀😀
thank you so so much. you started using let a while back and I asked my qualified friend to explain why and it didn't make sense other than they had different use cases... der.
after listening to this video it makes absolute sense and i will 100% be using let for, at least, my for loops. your videos are my biggest inspiration and I am just so glad that through whatever round about way, you are able to explain to me at least how all these abstract things work.
Thank you!
Hoisting and Nested loops is an nightmare for many people I think , you are an excellent teacher , your way of learning us is fantastic , the class table's explanation is the key to success , many greetings my friend !!
Great explanation! Thanks for this video!
Does hoisting happen in case of let also? Or any similar transpiling on let keyword before the interpreter can actually work on the instructions?
I wish all the teachers in colleges were like you. Amazing Skill.
exactly what i was looking for . now i know the differences
The first time I've watched a video from this channel I was thinking "what is wrong with that guy?". After the ending of the first video I've realized how good Dan's explanations are. Since then I'm following his videos and enjoying the way of braking difficult concepts into small pieces. I've learned a lot about JS and found answers of a lot of questions I've asked myself. Keep going, man! 10x for creating this amazing channel and being a person you are!
Greetings from Bonn, Germany.
There is nothing wrong with him :) He has a great personality.
Best Explanation ever on Let
Daniel shiffman: Legend. I tell everyone this.
This was one of the most entartaining video that I watched on `let` and `var` pretty fun, thank you :)
This is actually really good to know.
Fantastic explanation of Hoisting in JavaScript!
I don't use JS anymore but I am subscribed because you are so much fun to watch
So with let and var, the variable is typeless or dynamically typed?
This is really interesting. I had thought that it was some kind of optimization around declaring constants and variables that could change as functional programming became more fashionable. Thanks.
This video was fantastic.
Thank You for sharing your knowledge.
i started learning python but stopped to learn js because of this channel. I love the way you teach and your contents.
Love your stuff Daniel
This video is a gem.
over 9000 blessings to you sir for explaining this.
You are awesome , so are your videos
wow thats so well explained! thanks a lot you have new subscriber now
great video. I didn't even know what block scope or function scope was, just knew it was different and tricky. Now I know. thank you so much. Subscribed! looking forward to more of your videos :-)
Very helpful! Thanks Dan!
Man, I love your style. It's heuristic 😎😃
I have always used let, but I didn't know why until now :)
Very informative video , Thanks a Lot!
Very clear thank you for the video
This might sound like an odd question, but why can't I find this playlist on the Coding Train main RUclips site? In fact, there are a few tutorial series that I can't seem to directly, including the p5 Sound one. Am I missing something?
You explained this very well
Great work, you are the best: keep It on!
Thanks!
thx. Finally someone explained to me.
Tried the first part in p5.js editor, if I correct to console.log(x) then let x; followed by the rest, it results in the same error as let x =100; . I assume that they have updated it so that you can no longer call a variable before defining it with let.
thanks, really helps me a lot
So finally I understand the difference between let and var
Why not just add error msg when you declare two vars of the same name?
Thanks so much for this. I had been wondering and had been meaning to find out at some point but your examples were superb to effectively demonstrate the difference. Amusingly I'd never realised that "for (int i = etc" in C++ only had i in scope inside the loop. I mean it makes sense but I was never consciously aware of it. I guess I rarely tried to re-use the counter outside of the loop, or if I did, I guess I must have fixed it on auto-pilot without really thinking about it properly.
2:54 - 3:00 Aaaaaaaaaargh!
Very well explained. I am starting out with Javascript so a good piece of timing for me. Ive also looked at your video on Genetic Algorithms in P5.js. If viewers have not seen that its well worth a look. If you have a pdf of that video I would buy it. Keep up the good work
Great video!
Best teacher ever!
Great example! sometimes errors can be good news as well !
Great explanation, thanks for the video. =)
Let is useful :) Thanks man Now i get it
A new subscriber... Great explanation
Awesome, thank you! Best explanation for this that i've read/watched. Sidenote: when i was running the example where 100 was expected, i was getting undefined. I needed to run setup() after, so that part stumped me for a bit.
function setup() {
for (var i = 0; i < 100; i++);
}
console.log(i);
}
setup() // ;)
the best instructor everrrrrrrrrrrrrrrrr
I need some help on node loop
want to print n elements from the array after 10 seconds till complete array in a node so which is a better way
ex:
array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print:
1
2
sleep 10 sec
3
4
sleep 10 sec
.
.
9
10
in this way
"I'm soooo behinddd BTW" lol. thanks for the video though, very informative.
You present in a very entertaining way.
One thing you missed was lexical scope with let vs var. Think setInterval method.
I tripped up an interviewer on this when they were looking for a closure answer.
subscribed
Thanks for the feedback!
Excellent! Thank you!
nice video sir! you made my understanding clear!
Glad to hear!
can you explain me why "let" variables will never create a property in the global/window object say:
let x = 100;
console.log(window.x); // undefined
and can you explain me between a function declaration and a variable declaration which gets hoisted first
function x() {}
var x;
can anyone tell me what editor hes using
Great video!!! Thanks a lot!!!
I have just a question, when you say let j = 20, at the last part of the video, aren't you declaring a new variable?
expertly explained.
Now I understand thank you!
This is what being high on JS looks like XD
Mango Loving astronauts. Perfection.
Hello, very interesting video considering all the new frameworks of javascript and the popularity that it has gained ( React js etc.). Do you plan making a video about immutable js?
"let" is a keyword frequently seen in functional programming languages, which JS is slowly inching closer to becoming at least a language that allows for fully functional code.