Logical Short-Circuiting in JavaScript

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ต.ค. 2024
  • 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 ปีที่แล้ว +7

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

    • @remigiangolec7420
      @remigiangolec7420 2 ปีที่แล้ว

      omg missed this valuable information at first viewing, only to discover the implications of it during logical operators practice days later

  • @jayster900able
    @jayster900able 3 ปีที่แล้ว

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

  • @cigarAsh369
    @cigarAsh369 6 ปีที่แล้ว +2

    Thank you, sir. Very helpful

  • @chesterxp508
    @chesterxp508 3 ปีที่แล้ว

    Another very cool tutorial !!!

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

  • @iredits7621
    @iredits7621 3 ปีที่แล้ว

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

  • @shinigami2669
    @shinigami2669 4 ปีที่แล้ว

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

  • @bruhmoment3731
    @bruhmoment3731 2 ปีที่แล้ว

    cool!

  • @badbeatslayer
    @badbeatslayer 2 ปีที่แล้ว

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