Using JavaScript Strict Mode

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

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

Күн бұрын

This tutorial explains the difference between strict mode and sloppy mode in your scripts.
With the command "use strict" at the top of your file you can protect yourself from common typos and errors.
Starter Code GIST: gist.github.com/prof3ssorSt3v...

Пікірлер: 21
@rotrose7531
@rotrose7531 4 жыл бұрын
I am so lucky to find your channel on youtube, ever since all things changed. Thank you.
@kieranbarker1902
@kieranbarker1902 3 жыл бұрын
Great video as always, Steve. Thanks!
@lingyundai964
@lingyundai964 4 жыл бұрын
I love the way you explain things it is very intuitive
@pixzelplethora9815
@pixzelplethora9815 5 жыл бұрын
This will help me learn. "use strict"; Thank you.
@chesterxp508
@chesterxp508 2 жыл бұрын
Another very cool tutorial!
@JamesFraley
@JamesFraley 4 жыл бұрын
Very informative!
@spatz7576
@spatz7576 5 жыл бұрын
The last line of code shouldn't fail. You were confused by a mistake at 11:18. Function f1 has already been defined before let.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
Yes. I was just trying to show that you could write it as a function declaration or as a function expression. Either way would allow you to overwrite the older version of the function.
@Dev-ry9cx
@Dev-ry9cx 4 жыл бұрын
Ahh now i get what this Strict mode is !
@maksymantoshkin2896
@maksymantoshkin2896 5 жыл бұрын
Hello, as always great video! Remember you suggested me "You don't know JS" book series? That was absolutely awesome 😊👍😊👍, I learned a lot new things, thank you. Maybe you could suggest a book or any resource to learn advanced Node.jd? I would greatly appreciate it.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
Advanced NodeJS really depends on what you are meaning by that. Being an expert JavaScript developer will make you a better Node developer. If you read, understood and can apply everything you read in "You Don't Know JS" then you will be a very good JS and NodeJS developer. Beyond that it is just learning the different modules that are available in Node for working with Streams, File System, database, and different protocols (the things you don't do much of in the browser)
@RonWaller
@RonWaller 5 жыл бұрын
So is that where linting comes in to catch errors before you run the program and then get errors?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
Exactly
@sery152
@sery152 4 жыл бұрын
Thanks, good video. But I think the last part with let is wrong, I checked and the reassingment is working.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
With let you can reassign but not redeclare. Strict mode makes var work in the same way
@umoooo
@umoooo 3 жыл бұрын
thx
@tengun
@tengun 4 жыл бұрын
So even if we already have a function named f1, we can still declare a new variable named f1? Then, the function became inaccessible?
@samuelmatheson9655
@samuelmatheson9655 5 жыл бұрын
Yeah, thanks, but no thanks. i like my sloppy mode XD
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
Ok. I'll allow it. As long as you're using a linter.
@damo190
@damo190 3 жыл бұрын
U said, line 42 fails. But it works fine. I couldn't understand what u r trying to say here.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
I left off the "let" at the start of line 42. That is what would make it fail.
Hoisting with var vs let (and const)
9:31
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 14 М.
Understanding the Keyword THIS in JavaScript
13:59
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 8 М.
Heartwarming: Stranger Saves Puppy from Hot Car #shorts
00:22
Fabiosa Best Lifehacks
Рет қаралды 20 МЛН
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 34 МЛН
The child was abused by the clown#Short #Officer Rabbit #angel
00:55
兔子警官
Рет қаралды 24 МЛН
Understanding the JavaScript Prototype Chain
21:45
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 12 М.
Logical Short-Circuiting in JavaScript
9:51
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 6 М.
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,1 МЛН
This One Line Of Code Catches React Bugs For You
15:55
Web Dev Simplified
Рет қаралды 57 М.
Combining Async Await with Promises
9:10
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 7 М.
JavaScript Classes vs Prototypes
14:39
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 62 М.
Learn React Hooks: useCallback - Simply Explained!
17:15
Cosden Solutions
Рет қаралды 77 М.
JavaScript this Keyword
8:21
Programming with Mosh
Рет қаралды 448 М.
JavaScript Was So Bad They Had To Add A Second Mode To Fix It
12:54
Web Dev Simplified
Рет қаралды 64 М.
JS Code Structure Moving Beyond Beginner
21:31
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 13 М.
Heartwarming: Stranger Saves Puppy from Hot Car #shorts
00:22
Fabiosa Best Lifehacks
Рет қаралды 20 МЛН