++ Increment, always adds +1 to a variable.

+= is a shortened form.

Example

var num = 2;
num+=4;

num will increase by 4.

One more example

var str = 'Hello'; 
str = ' world';
alert(str); // will get the world.

var str = 'Hello'; 
str += ' world';
alert(str); // will get the Hello world.
0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like