Short-Circuiting and Falsy Values

    • Hello Guy’s , look at my code at ‘// Doubt Below Here ’ comment in my code. As per my knowledge when ever I use && operator it searches for the ‘falsy’ value in the expression, I have a falsy value as ‘’ but the resutl i’m getting rest2 is ‘’{ name: ‘Pizza’, owner: ‘Giovanni Rossi’, numGuests: 10 } ​​​​​at ​​​​​​​​rest2​​​ ​script.js:87:1’’ , The result i ‘ve to get is ’ ’. but here the && operator doesn’t stop at falsy value.
  1. [8:38 PM]


    [Hello Guy’s , look at my code at '// Doubt Below Here ’ comment in my code. As per my knowledge when ever I use && operator it searches for the ‘falsy’ value in the expression, I have a falsy value as ‘’ but the resutl i’m getting rest2 is ‘’{ name: ‘Pizza’, owner: ‘Giovanni Rossi’, numGuests: https://codepen.io/kavuriramesh/pen/OJBByow?editors=1111](Hello Guy’s , look at my code at '// Doubt Below Here ’ comment in my code. As per my knowledge when ever I use && operator it searches for the ‘falsy’ value in the expression, I have a falsy value as ‘’ but the resutl i’m getting rest2 is ‘’{ name: ‘Pizza’, owner: ‘Giovanni Rossi’, numGuests: https://codepen.io/kavuriramesh/pen/OJBByow?editors=1111)

<ANONYMOUS> is not a falsy value. Its a non-empty string, which is truthy.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.