javascript - What is the difference between x++ and ++x -


possible duplicate:
incrementing in c++ - when use x++ or ++x?

what difference between x++ , ++x ?

x++ executes statement , increments value.

++x increments value , executes statement.

var x = 1; var y = x++; // y = 1, x = 2 var z = ++x; // z = 3, x = 3 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -