JavaScript for Beginners - let vs. var

preview_player
Показать описание
In this video I will show you the difference between declaring variables with let and var in JavaScript.

00:00 Intro
00:06 1 - Scope
03:38 2 - Redeclaring
05:20 3 - Hoisting

#javascriptforbeginners #javascript #coding #letvsvar

saperis - Technology made easy

Рекомендации по теме
Комментарии
Автор

Excellent video, thank you so much... by the way, to store Sarah in name, just type name = 'Sarah' after the name variable declaration

ansuarezv
Автор

Great explanation, thank you. You're a great teacher.

donyelldf
Автор

I loved your explanations and your teaching ways. it helps me a lot. for answering your question.
since you mention at your course that let data type cannot be redeclared in the same block, so i guess to redeclared the values, just declare out of the block, so it would be like:
function greet(){ let name = 'jane'; console.log('Greeting you ' + name); }//this is the 2nd block
let name = 'Sarah'; console.log('Greeting you ' + name);

bambangpriantoro
Автор

Very good explanation. The video helped me to understand more.

zk
Автор

When would it be better to use "let" than "var" ?

CrudeOilisOrganicYouKnow