Answers for "javascript diffence between a++ and ++a"

0

javascript diffence between a++ and ++a

// ++i returns the value of i after it has been incremented. i++ returns the value of i before incrementing.

// When the ++ comes before its operand it is called the "pre-increment" operator, and when it comes after it is called the "post-increment" operator.

// This distinction is only important if you do something with the result.

var i = 0, j = 0;

alert(++i);  // alerts 1
alert(j++);  // alerts 0
Posted by: Guest on February-03-2020

Code answers related to "javascript diffence between a++ and ++a"

Code answers related to "Javascript"

Browse Popular Code Answers by Language