Operators > += (addition assignment)

+= (addition assignment)

Syntax

expression1 += expression2

Arguments

expression1,expression2 Integers, floating-point numbers, or strings.

Description

Operator (compound assignment); assigns expression1 the value of expression1 + expression2. This operator also performs string concatenation.

Player

Flash 4 or later.

Example

This following illustrates a numeric use of the += operator:

x += y is the same as x = x + y

If x = 5 and y = 10 then

x += 10 returns 15

This example illustrates using the += operator with a string expression:

x = "My name is"
x += "Mary"

The result for the above code is as follows:

"My name is Mary"

See also

+ (addition)