param1 + param2
Operand types
Type of returned value
Description
Unary plus: returns result of param1 plus param2.
Following Types are possible:
Number - + a: Unary plus: returns a
Return value type: Number
Number - a + b: Add a to b
Return value type: Number
Array - + array: Unary plus: returns a copy of the array
Return value type: Array
Array - arrayA + arrayB: arrayA and arrayB are concatenated
Return value type: Array
String - stringA + stringB: stringA and stringB are concatenated
Return value type: String
Used In
OFP/ArmA
Example
+ 4 ..........Result is 4
counter + 1
+ [0, 1, 2] ..........Result is [0, 1, 2]
[0, 1, 2] + [1, 2, 3] ..........Result is [0, 1, 2, 1, 2, 3]
"I" + " am" + " blind" ..........Result is "I am blind"
_array = [];
_array = _array + "stuff";
will not work because it attempts to combine an array and a string. You'll have to type
_array = _array + ["stuff"];
instead.