About the side effects of operators and expressions

    var a = 1, c;
    
    c = (aPP) + a;
    console.log(c); // 3
aPPa2

 c = (2) + 243

PPa
Mar.01,2021

c = (aPP) + a is equivalent to the following:

var t1 = a;
aPP;
var t2 = a;
c = t1 + t2;

In which T1 is 1 and T2 is 2 , which is leading to the result 3 .

And if you write the code like c = (PPa) + a , it will be interpreted as the following:

aPP; // or more precisely, PPa
var t1 = a;
var t2 = a;
c = t1 + t2;

And you will get 4 ;


aPP is to return the value first
PPa is to perform the operation first in the return value

so this expression (aPP) + a; operation logic is: first return (aPP) as a equals 1 , then when performing PP operation axi2 so canti3 ;

if your expression is (PPa) + a; , then the result is 4

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea7288-1e34.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea7288-1e34.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?