Let vs. Const in JavaScript - What's the Difference?

preview_player
Показать описание
In today's video I'll be explaining the difference between let and const in JavaScript, how they work and when you should use one over the other.

Enjoy 😀

For your reference, check this out:

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

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

You’re simply awesome with your simplified explanation. Thanks for teaching us.

SaifRaihan
Автор

Dude thank you for making this video after watching this video, it really helped me understand!!

laseangames
Автор

awesome, very updated and informational!

cindymin
Автор

Great video! I was wondering if you had any tips for a small programming channel like myself? Thanks!

neelbanga
Автор

What about performance? Is there a benefit to using const instead of let?

VivekTR
Автор

Wait, can you modify an array/object declared with "const"?
I thought const declarations were immutable
Great video btw!

I personally like Rust's take on declaring variables though
In Rust, all variable declarations are immutable by default
Or you need the additional "mut" keyboard to _specifically_ make it immutable
It makes you think whether you will really need to mutate the value

nikhilmwarrier
Автор

Can you make video for junior job JS with examples ? You have great videos and explanations :)

markopetrovic
Автор

what's the difference with var and let though? why is let better than var?

blackslashXD
Автор

'const' is harder to press in keypads than 'let', hahaha, extra two keypress, i hope in the future the jsGroup will change it to 'con' only, haha!

chrisplusplus
Автор

Why not just use "let" all the time? The difference is that let can be reassigned, but what consequense does it have to use let and NOT assign it anything, versus having used const to do so? Seems like "Let" is just flexible when you need it to

OneBrokeBloke
Автор

Best animation js library anime.js Vs gsap

prudhvichinnam
welcome to shbcf.ru