Logical Short-Circuiting in JavaScript

  Рет қаралды 5,553

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

6 жыл бұрын

There is a built-in behaviour in JavaScript designed to make it faster to process commands. If you combine two expressions with a logical AND operator, the JavaScript interpreter will look at the expression on the left side first. It will ONLY look at the one on the right IF the one on the left side evaluated to true.
Ternary Operator Video : • Javascript Ternary Ope...

Пікірлер: 16
@rotrose7531
@rotrose7531 4 жыл бұрын
A function that has no return statement will by default return undefined. This is now firmly remembered in my head. Thank you.
@remigiangolec7420
@remigiangolec7420 Жыл бұрын
omg missed this valuable information at first viewing, only to discover the implications of it during logical operators practice days later
@jayster900able
@jayster900able 2 жыл бұрын
Love how you really explain things for newbie future devs!
@allenrichardyeager8449
@allenrichardyeager8449 3 жыл бұрын
Thank you so much, I read JS book and It's not clear about this topic. The way you explain short circuiting logical is open my mind. Great job 👏🏻
@chesterxp508
@chesterxp508 2 жыл бұрын
Another very cool tutorial !!!
@cigarAsh369
@cigarAsh369 5 жыл бұрын
Thank you, sir. Very helpful
@maxtayebwa8987
@maxtayebwa8987 5 жыл бұрын
Very helpful indeed. Prof, would do a series on best code practices in JS and PHP? I really think it would be a great one! Thanks otherwise prof...
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
Thanks. Please post that on my tutorial request video
@shinigami2669
@shinigami2669 4 жыл бұрын
does this work same when we use or(||) operator?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
yes.
@bruhmoment3731
@bruhmoment3731 Жыл бұрын
cool!
@badbeatslayer
@badbeatslayer Жыл бұрын
8:39 how is the f() returning "no" now? I watch it 3 times, can' understand ...help please !
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
f() is writing 'yes'. g() returns undefined and then logs out 'no'.
@iredits7621
@iredits7621 3 жыл бұрын
It sounds like you are destroying your mouse everytime you click it lol. Very helpful video though, great job!
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
It was my old microphone picking up the trackpads clicks.
Composition vs Inheritance in JavaScript
12:23
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 11 М.
JS Bitwise Operators and Binary Numbers
26:01
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 10 М.
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 30 МЛН
Truthy & Falsy Values in JavaScript
7:22
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 12 М.
Chrome Dev Tools Source Panel and Breakpoints
18:21
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 6 М.
Short Circuiting With && and || (JavaScript)
4:09
ByteGrad
Рет қаралды 3,5 М.
ES5 Custom Object Methods, Getters, and Setters
9:49
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 12 М.
Download Progress Monitoring with SVG Animation
32:14
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 1,2 М.
Understanding the Keyword THIS in JavaScript
13:59
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 8 М.
NaN and isNaN in JavaScript
8:46
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 13 М.
Create Your Own NPM Modules
19:36
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 5 М.