0
why the result is 8??
var a = 6; var b = 3; b--; document.write(a+b);
5 odpowiedzi
+ 7
because b--; change the value of b from 3 to 2... remember: "b--;" is the same as if you typed "b=b-1;"... when you get to the next line, a+b is equal to 6+2 which gives you 8 as a result.
+ 1
var a = 6;
var b = 3;
b--; // b become 2 after this line
document.write(a+b); // 6 + 2
+ 1
6+2
0
The result 8 of what?
0
yes please upvote :)