0
why got it this result in decrement var? javascript
this result it would be 12 not 11 . I dont undersand it var a = 10; var b = 11; var c; if (a++ >= 10 || b++ >= 11) { console.log(b); } //output 11 Does it evaluate the first conditional and not go through the second? by the operator || since el first condicional it is true ???
2 Answers
+ 7
Carlos Alfonso Terrazas Valencia you guessed it right. If the first condition is true then the second one is ignored because OR returns true even if one condition is true.
+ 2
@Avinesh Thanks!