+ 3

Could someone explain me how this code works line to line? Thanks.

var X=10; var x=7; var c=5; var z=(x*x)-(x); document.write(X-x); document.write(z);

3rd May 2018, 1:13 PM
Rastislav Romanec
Rastislav Romanec - avatar
1 ответ
+ 8
z = 7*7 -7 = 49-7 = 42 X-x = 10-7 = 3 output: 342 Tips: I'm seeing that you have posted number of questions of this kind. You can easily trace your code by printing the variables on each step, it helps a lot. Good day :)
3rd May 2018, 1:25 PM
Shamima Yasmin
Shamima Yasmin - avatar