var let const - Variable Declarations in JavaScript

  Рет қаралды 6,276

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

Күн бұрын

The original variable declaration in JavaScript was "var". This gave us local and global scope.
In ES6, we gained the ability to create block scoped variables as well as constants. "let" gives us a replacement for variable declaration which is block scoped. "const" lets us create constants, which are variables that cannot be reassigned with new values.

Пікірлер: 24
@rotrose7531
@rotrose7531 4 жыл бұрын
Thank you very much for these super crystal-clear explanations!
@Colstonewall
@Colstonewall 7 жыл бұрын
Excellent explanation Steve. Thanks!
@aliasanov8790
@aliasanov8790 5 жыл бұрын
Thanks, as always great explanation of important things!
@chesterxp508
@chesterxp508 3 жыл бұрын
Brilliant tutorials !!!
@naysolutions4225
@naysolutions4225 4 жыл бұрын
Great content #letDeclarations
@peternydahl6150
@peternydahl6150 2 жыл бұрын
Great video!
@jeff-creations
@jeff-creations 2 жыл бұрын
Another great video! Unrelated question: How do you get the black box shadow on the ( 55%?) linear gradient for your youtube thumbnail?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 2 жыл бұрын
Photoshop drop shadow on the layer.
@jeff-creations
@jeff-creations 2 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Ahha! I was looking all over the place trying to figure out how you did that with CSS. Taking a little break from JS and learning more CSS this week. Thanks for the quick response. Hope your weekend rocks!
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 2 жыл бұрын
@@jeff-creations You can do it in CSS with this - kzbin.info/www/bejne/iXfVgayri7iXp7M Also have a look at - kzbin.info/www/bejne/gYOcaWWMrpJpa9E
@jeff-creations
@jeff-creations 2 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Sorry for the delay. Somehow I missed your response. I will absolutely check out those videos. I just bookmarked both of them. Thanks again!
@EDC.EveryDayCode
@EDC.EveryDayCode 4 жыл бұрын
Var values can bleed out from one local scope into the block containing said scope. and jump scopes. So Let and Const are stricter.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
Let and const are stricter. Yes. Var doesn't bleed out it just has local scope instead of block scope.
@kapkaal
@kapkaal 5 жыл бұрын
excellent series..going through them one by one..!! hope u et maore subscribers the numbers aint doing justice to ur knowledge!!
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
Thanks. Please share the videos you like to help other people too.
@johnywhy4679
@johnywhy4679 4 жыл бұрын
3:43 How is a block-level global variable (let) different from a non-block-level global variable (var)?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
A global variable declared with any - const, let, or var - will have the same scope. Declared with `var` will also create a property on the window object of the same name. let abc = 'global'; var def = 'global'; window.abc // undefined window.def // 'global'
@johnywhy4679
@johnywhy4679 4 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 "A global variable declared with any - const, let, or var - will have the same scope." Sorry, same as what? thx
@EDC.EveryDayCode
@EDC.EveryDayCode 4 жыл бұрын
@@johnywhy4679 I think he meant they will all have a global scope. (except in the case of the window object, which represents an open window in a browser. and is something additional to take into consideration.)
@jasbindarsingh1640
@jasbindarsingh1640 4 жыл бұрын
hey Steve, does let variables are not hoisted. // console.log(a); let a; Gives a reference error // a = 5; console.log(a); let a; This gives a reference error too //
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
kzbin.info/www/bejne/mXncqpeLo9iUjas - I've answered that in this video.
@Rajeshwari141
@Rajeshwari141 4 жыл бұрын
Love your Lord of the Rings references
@MrMarkgyuro
@MrMarkgyuro 5 жыл бұрын
so is this a c++ tutorial ? : D
@yarik83men51
@yarik83men51 5 жыл бұрын
+++
Understanding the Keyword THIS in JavaScript
13:59
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 9 М.
Variable Scope
6:26
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 6 М.
Triple kill😹
00:18
GG Animation
Рет қаралды 18 МЛН
Человек паук уже не тот
00:32
Miracle
Рет қаралды 4 МЛН
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 130 МЛН
Elza love to eat chiken🍗⚡ #dog #pets
00:17
ElzaDog
Рет қаралды 25 МЛН
Differences Between Var, Let, and Const
8:37
Web Dev Simplified
Рет қаралды 193 М.
Hoisting with var vs let (and const)
9:31
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 14 М.
JavaScript Let vs Var vs Constant | Mosh
6:51
Programming with Mosh
Рет қаралды 290 М.
Javascript Function Expression Vs Declaration For Beginners
5:30
Dev Material
Рет қаралды 14 М.
FASTEST Way To Learn Coding and ACTUALLY Get A Job
10:44
Brian Cache
Рет қаралды 1,2 МЛН
Learn JavaScript Scoping In 10 Minutes
11:39
Web Dev Simplified
Рет қаралды 62 М.
JavaScript Function Return Statements
9:52
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 26 М.
Naming Things in Code
7:25
CodeAesthetic
Рет қаралды 2,2 МЛН
Triple kill😹
00:18
GG Animation
Рет қаралды 18 МЛН