Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Short-Circuit Evaluation#

Sumit Rawal answered on May 23, 2023 Popularity 8/10 Helpfulness 2/10

Contents


More Related Answers

  • short-circuit evaluation javascript
  • short-circuit evaluation , use of || operator

  • Short-Circuit Evaluation#

    0

    Note that && and || do not always need their right operand to be evaluated. For instance, when using &&, if our first operand is false, our final result will always be false irrespective of the second operand. Expressions which are built with && and || are only evaluated as far as needed to determine the result. This is why we say these expressions use short-circuit evaluation.

    Hence, when the compiler sees false &&....., it will return false without evaluating what comes after &&. This reduces unnecessary compile time.

    That sums up logical operators. Let’s move on to bitwise operators in the next lesson.

    Popularity 8/10 Helpfulness 2/10 Language whatever
    Source: Grepper
    Tags: whatever
    Link to this answer
    Share Copy Link
    Contributed on May 23 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.