What is the output of following code?
var a = 10; console.log(a++); console.log(++a);
The output is:
Post increment operator first prints the value(
10) and then increments
a to 11. Pre increment first increments the value and then prints. So the 11 is first incremented to
12 and then printed to console.