Logical Short-Circuiting in JavaScript

preview_player
Показать описание
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.

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

A function that has no return statement will by default return undefined. This is now firmly remembered in my head. Thank you.

rotrose
Автор

Love how you really explain things for newbie future devs!

jaysterable
Автор

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 👏🏻

allenrichardyeager
Автор

8:39 how is the f() returning "no" now? I watch it 3 times, can' understand ...help please !

badbeatslayer
Автор

does this work same when we use or(||) operator?

shinigami
Автор

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...

maxtayebwa
Автор

It sounds like you are destroying your mouse everytime you click it lol.
Very helpful video though, great job!

iredits