+

From Bohemia Interactive Community
Revision as of 15:33, 6 February 2019 by Lou Montana (talk | contribs) (Page creation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Add two numbers, concatenate two arrays or two strings, or duplicate an array.
Groups:
Uncategorised

Syntax 1

Syntax:
a + b
Parameters:
a: Number
b: Number
Return Value:
Number

Syntax 2

Syntax:
arrayA + arrayB
Parameters:
arrayA: Array
arrayB: Array
Return Value:
Array - a new array filled with arrayA and arrayB elements, in that order.

Syntax 3

Syntax:
stringA + stringB
Parameters:
stringA: String
stringB: String
Return Value:
String - a string concatenating stringA and stringB

Syntax 4

Syntax:
+ array
Parameters:
array: Array
Return Value:
Array - a new instance of array filled with same items.

Examples

Example 1:
5 + 3; // returns 8 -5 + -3; // returns -8
Example 2:
_arrayA = [1,2,3]; _arrayB = [4,5,6]; _arrayAB = _arrayA + _arrayB; // _arrayAB = [1,2,3,4,5,6] // _arrayA and _arrayB remain unchanged
Example 3:
_result = "Hello" + " " + "there"; // "Hello there"
Example 4:
_arrayA = [1,2,3]; _arrayB = +_arrayA; _arrayB set [0, 99]; // _arrayA = [1,2,3], _arrayB = [99,2,3]

Additional Information

See also:
Operators

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Bottom Section