Can You Solve This JavaScript Problem?

preview_player
Показать описание
Can you solve this JavaScript hard question based on short-circuit evaluation?

Prepping for your frontend interviews? Use code "conner" for a discount on my course FrontendExpert:

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

a || b is effectively the same as a ? a : b

Nicoder
Автор

"so we are just geting whatever the f... irst value"
got me there.

javiervillacorta
Автор

Short circuiting is great specially with ??

emmanuelmantilla
Автор

Does it happens with any type ? If I have an Object in the first param and if it exists will return it ? Cuz so, I can use that instead of if(Object)

marcelolaurentinomelo
Автор

True1 || true2 = True1
True1 && true2 = true2

shivanshsharma
Автор

Mathematically, logically, reasonably, this **should** return TRUE and i refuse to accept any other answer. Bad language, 2/10 (there's a lot of libraries and it runs in a web browser).

KiriIrving
Автор

idk if I'd hate js for this 😂 but thanks to falsy truthy values, I don't have to write something like string.isNullOrEmpty in C#

ninhdang
Автор

Wow another completely random useless thing

Vebol
Автор

Is JavaScript developed by fifth grader😅

tao
welcome to shbcf.ru