+ 5
Anybody tell me what will be this output. var a = 5; var b = ++a; var c = b++; alert(a+b+c); Also tell how.PLEASE.
I can't understand how to calculate it.
3 Réponses
+ 5
a = 5,
b = ++a //b= 6 and a = 6
c = b++ // c = 6 and b= 7
Therefore a+b+c = 6+7+6 = 19
+ 3
Thanks a lot
+ 2
var a=5
var b=++5 which is pre increment happening here
So, var b=6
var c=b++ which is post increment happening here ,so
var c=6 ,b is is incremented to 7 now
So 5+7+6