Hi, mastering JavaScript is critical if you want to be a modern, professional developer: www.udemy.com/course/professional-javascript-course/?referralCode=0C1D5752923168BC87C2 Also, if you are a front-end developer then mastering CSS (including Flexbox, CSS Grid, etc.) is equally important: www.udemy.com/course/professional-css/?referralCode=4C3C08E82629E6B15752
Easy and straight to the point. Here's my insights I got from the video: && --> both conditions must be true in order to run the second part. If one is false, the condition is immediately false and will not even take into consideration, the second part. Both conditions must be true || --> if the first condition is true, immediately stop. if the first condition is false, then run the other condition.
I have been testing and here's what I noticed : if you said console.log(9) && 1, you would still receive a log to your console because even though you evaluated the whole expression to "false" (console.log returns undefined), it still ends up logging your input as an indirect operation. So, the actual logging of the input still happens independently of whether it is evaluated as "true" or "false". Finally, it shortcircuits to the first false operand/evaluates its value, and if all operands happen to be true, it always takes the value of the last operand. Is this a correct understanding? Thanks
Hi, mastering JavaScript is critical if you want to be a modern, professional developer: www.udemy.com/course/professional-javascript-course/?referralCode=0C1D5752923168BC87C2
Also, if you are a front-end developer then mastering CSS (including Flexbox, CSS Grid, etc.) is equally important: www.udemy.com/course/professional-css/?referralCode=4C3C08E82629E6B15752
Easy and straight to the point.
Here's my insights I got from the video:
&& --> both conditions must be true in order to run the second part. If one is false, the condition is immediately false and will not even take into consideration, the second part. Both conditions must be true
|| --> if the first condition is true, immediately stop. if the first condition is false, then run the other condition.
Short and direct thanks mate 🌹
Thank you. Just what I needed.
concise explanation, thanks
Great man. Keep it up🙌🏼🙌🏼
Great Video! understood 😎😎 ty
Thank you! What theme are you using ?
thank you so very much
I have been testing and here's what I noticed : if you said console.log(9) && 1, you would still receive a log to your console because even though you evaluated the whole expression to "false" (console.log returns undefined), it still ends up logging your input as an indirect operation. So, the actual logging of the input still happens independently of whether it is evaluated as "true" or "false". Finally, it shortcircuits to the first false operand/evaluates its value, and if all operands happen to be true, it always takes the value of the last operand. Is this a correct understanding? Thanks
So it's just a simplified if statement. Is that the point? Instead of writing an if statement you could just && or ||
Yep
@@ByteGrad thanks