Var vs Const vs Let (ES6) - Beau teaches JavaScript

Var vs Const vs Let (ES6) - Beau teaches JavaScript

freeCodeCamp.org

7 лет назад

70,414 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@shrdn2960
@shrdn2960 - 23.07.2023 00:36

Based.

Ответить
@ashilshah3376
@ashilshah3376 - 28.01.2023 17:47

On point thankyou :)

Ответить
@rayjaymor8754
@rayjaymor8754 - 27.12.2022 07:07

In less than 4 minutes you explained to me in an easily understandable manner what 30 minute videos and several pages of documentation couldn't get through my skull. Thank you!

Ответить
@sandiladhikari7903
@sandiladhikari7903 - 21.12.2022 13:29

And if you use for(i = 0; i < 3; i++) without assigning neither let nor var keyword, the i becomes global variable.

Ответить
@antsanders0893
@antsanders0893 - 09.12.2022 15:54

Thank you for making this 80 times easier than Codeacademy lol

Ответить
@aceborja1656
@aceborja1656 - 29.07.2022 07:21

Thank you once again Beau for clarifying.

Ответить
@mikaelsilva5651
@mikaelsilva5651 - 30.03.2022 23:37

Everything is clear to me now. Thanks for explaining the difference between const, let and var.

Ответить
@itzDJ73
@itzDJ73 - 04.02.2022 20:48

Very helpful. Thank you!

Ответить
@BIA_JOE
@BIA_JOE - 30.01.2022 21:37

thanks bro

Ответить
@sayantaniguha8519
@sayantaniguha8519 - 21.07.2021 12:37

for(var i=1;i<=5;i++)
{
setTimeout(function(){ console.log(i) },1000);
}

Why does it give o/p 6 ?
It should give
1
2
3
4
5
...but it isnt,, whyy ??..
Plz give me an explanation related to hoisting

Ответить
@pratikpokharel5490
@pratikpokharel5490 - 15.05.2021 16:13

crisp and clear,covered everything needed less than 4mins.THANKS

Ответить
@_runic
@_runic - 22.04.2021 03:42

tl;dr
let - local variables that can be changed
var - global variables that can be changed
const - constant variables that cannot be changed

Ответить
@anthonyraja5601
@anthonyraja5601 - 09.03.2021 17:55

Thank you!!!!!!!!!!!!!!!!!!!!!

Ответить
@ashfepranto8621
@ashfepranto8621 - 26.12.2020 10:32

Thanks a lot dude..

Ответить
@moza260
@moza260 - 12.11.2020 00:53

ok the var and const is easy thing to remember when first learn, so the let key point is scoop right?

Ответить
@abhinavkumar8396
@abhinavkumar8396 - 24.10.2020 09:09

Best exact ,to the point,explanation. Beautiful.

Ответить
@unperrier5998
@unperrier5998 - 15.10.2020 13:37

did you know that semicolons are optional? Why bother then?

Ответить
@aybak3k
@aybak3k - 29.08.2020 20:37

let: block-lvl VARs - values can be changed
const: values never change
var: srsly u don need an explaination for dis:)

Ответить
@stevenshelby2675
@stevenshelby2675 - 06.06.2020 14:45

This guy makes you think you're watching this video at 1.5x speed

Ответить
@peeyushgupta1633
@peeyushgupta1633 - 02.06.2020 11:58

var also binds itself to window object, but let and const dont do that

Ответить
@boriiinglastname8810
@boriiinglastname8810 - 20.02.2019 14:01

Ur voice is weird

Ответить
@ashok2484
@ashok2484 - 13.02.2019 11:55

Bro ...what are the basic things are known in js

Ответить
@debjyotichattopadhyay6679
@debjyotichattopadhyay6679 - 30.01.2019 06:14

watched at 0.5* speed

Ответить
@blackzerosrb
@blackzerosrb - 21.12.2018 19:19

If we used code for hack, is that counting as for good, hack++ :D

Ответить
@hyunchae2431
@hyunchae2431 - 25.11.2018 04:56

without explanation on hoisting, it is not clear why 'var' variable is already available even before it is defined.

Ответить
@mikestuff2114
@mikestuff2114 - 03.05.2018 23:56

Thank you for keeping it short and to the point.

Ответить
@truptisutar2975
@truptisutar2975 - 08.03.2018 08:38

good explanation

Ответить
@yanivsalman9685
@yanivsalman9685 - 10.11.2017 11:59

you can push to a const variable thats important (:

Ответить
@sua4443
@sua4443 - 26.10.2017 20:25

should you use let instead of var when you can or does it not really matter?

Ответить
@sua4443
@sua4443 - 26.10.2017 20:25

should you use let instead of var when you can or does it not really matter?

Ответить
@christianrodier3381
@christianrodier3381 - 04.10.2017 01:18

That helped a great deal thanks.

Ответить
@batfan1939
@batfan1939 - 25.09.2017 23:35

Does this mean we don't need to change or "increment" i anymore? We can use let in loops, and have all of them be i = foo, i < bar, i++?

Ответить
@ylioo
@ylioo - 10.06.2017 12:29

This is how you explain it, idk what's up with this 20 min vidoes, let vs var vs const

Ответить
@theonewhodoesPoland
@theonewhodoesPoland - 10.02.2017 13:09

Clear explanations, thanks for sharing!

Ответить
@pleabargain
@pleabargain - 09.02.2017 17:32

Many thanks! Much clearer now!

Ответить
@trappedcat3615
@trappedcat3615 - 09.02.2017 15:46

I just use var, closures, and caps to indicate constants. I'll use const and let in 5 years once I don't need to depend on a compiler to interpret them.

Ответить
@PratikRatnaparkhi
@PratikRatnaparkhi - 09.02.2017 14:46

go beau! go beau! I love this guy!

Ответить
@SamiNami
@SamiNami - 09.02.2017 14:41

Thanks

Ответить