+

From Bohemia Interactive Community
Jump to navigation Jump to search
Introduced with Operation Flashpoint version 1.00
  

Click on the images for descriptions

Introduced in

Game:
Operation Flashpoint
Version:
1.00

Description

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

Syntax

Syntax:
numberA + numberB
Parameters:
numberA: Number
numberB: Number
Return Value:
Number - the sum of numberA and numberB

Alternative Syntax

Syntax:
+ numberA
Parameters:
numberA: Number
Return Value:
Number - returns numberA

Alternative 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.

Alternative Syntax 3

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

Alternative Syntax 4

Syntax:
+ arrayA
Parameters:
arrayA: 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:
+ 2; // returns 2 + -7; // returns -7
Example 3:
_arrayA = [1,2,3]; _arrayB = [3,4,5]; _arrayAB = _arrayA + _arrayB; // _arrayAB = [1,2,3,3,4,5] // _arrayA and _arrayB remain unchanged
Example 4:
_result = "Hello" + " " + "there"; // "Hello there"
Example 5:
_arrayA = [1,2,3]; _arrayB = +_arrayA; _arrayB set [0, 99]; // _arrayA = [1,2,3], _arrayB = [99,2,3]

Additional Information

Multiplayer:
-
See also:
Operators

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Bottom Section