0
Could anyone help me to understand the logic / process happening behind the scenes ? Thanks in advance.
What is the output of this code ? var a = 10; var b = 11; var c; if (!(a++ >= 10 || b++ >= 11)) { c = a + b; alert(a + "" + c); } else { alert(a + "" + b); } }
1 Respuesta
+ 1
a++ >= 10 happens like
=> 10>=10 and a=a+1
=>true, a=11
so if (! (true || b++>=11))
=> If (! (true))
=> If false
So Then else part get executed..
alert(a + "" + b)
=> 11 11