dimanche 29 mars 2015

Java vs JavaScript increment operator



In Java, if I do this



int value = 3;
int incr = value++;


incr is 4


but in JavaScript,



int value = 3;
int incr = value++;


incr is 3


in order for incr to be 4 in JS I have to do



int incr = ++value;


why is this?




Aucun commentaire:

Enregistrer un commentaire