{"name":"+","operator":"+","title":"+","type":"command","url":"https://community.bistudio.com/wiki/%2B","revid":377977,"updated":"2026-01-19T18:47:06Z","groups":["Math","Arrays","HashMap","Strings"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Add two Numbers, concatenate two Arrays or two Strings, or create a copy of an Array or HashMap.\n\n> [!WARNING]\n> Array copy methods `ARRAY + []` and `+ ARRAY` have different behaviours:\n> - `ARRAY + []` creates copy of the 1st dimension, but preserves references in other dimensions ([shallow copy](https://en.wikipedia.org/wiki/Object_copying#Shallow_copy)).\n> - `+ ARRAY` clones every element, so if the array is multi-dimensional, the created copy contains no references ([deep copy](https://en.wikipedia.org/wiki/Object_copying#Deep_copy)).\n> See Example 6.","syntaxes":[{"syntax":"numberA + numberB","since":null,"effect":null,"exec":null,"params":[{"name":"numberA","type":"Number","optional":false,"default":null,"description":null,"types":["Number"],"since":null,"text":"numberA: Number"},{"name":"numberB","type":"Number","optional":false,"default":null,"description":null,"types":["Number"],"since":null,"text":"numberB: Number"}],"returns":{"type":"Number","types":["Number"],"description":"the sum of numberA and numberB","text":"Number - the sum of *numberA* and *numberB*"},"form":"binary","operator":"+","left":{"text":"numberA","types":["Number"]},"right":{"text":"numberB","types":["Number"]}},{"syntax":"+ number","since":null,"effect":null,"exec":null,"params":[{"name":"number","type":"Number","optional":false,"default":null,"description":null,"types":["Number"],"since":null,"text":"number: Number"}],"returns":{"type":"Number","types":["Number"],"description":"the value of the parameter number","text":"Number - the value of the parameter *number*"},"form":"unary","operator":"+","left":null,"right":{"text":"number","types":["Number"]}},{"syntax":"arrayA + arrayB","since":null,"effect":null,"exec":null,"params":[{"name":"arrayA","type":"Array of Anything","optional":false,"default":null,"description":null,"types":["Array","Anything"],"since":null,"text":"arrayA: Array of Anything"},{"name":"arrayB","type":"Array of Anything","optional":false,"default":null,"description":null,"types":["Array","Anything"],"since":null,"text":"arrayB: Array of Anything"}],"returns":{"type":"Array of Anything","types":["Array","Anything"],"description":"a new array filled with arrayA and arrayB elements, in that order","text":"Array of Anything - a new array filled with *arrayA* and *arrayB* elements, in that order"},"form":"binary","operator":"+","left":{"text":"arrayA","types":["Array","Anything"]},"right":{"text":"arrayB","types":["Array","Anything"]}},{"syntax":"stringA + stringB","since":null,"effect":null,"exec":null,"params":[{"name":"stringA","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"stringA: String"},{"name":"stringB","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"stringB: String"}],"returns":{"type":"String","types":["String"],"description":"a string concatenating stringA and stringB","text":"String - a string concatenating *stringA* and *stringB*"},"form":"binary","operator":"+","left":{"text":"stringA","types":["String"]},"right":{"text":"stringB","types":["String"]}},{"syntax":"+ array","since":null,"effect":null,"exec":null,"params":[{"name":"array","type":"Array of Anything","optional":false,"default":null,"description":null,"types":["Array","Anything"],"since":null,"text":"array: Array of Anything"}],"returns":{"type":"Array of Anything","types":["Array","Anything"],"description":"a new instance of the provided array filled with same elements ([deep copy](https://en.wikipedia.org/wiki/Object_copying#Deep_copy))","text":"Array of Anything - a new instance of the provided array filled with same elements ([deep copy](https://en.wikipedia.org/wiki/Object_copying#Deep_copy))"},"form":"unary","operator":"+","left":null,"right":{"text":"array","types":["Array","Anything"]}},{"syntax":"+ hashMap","since":"arma3 2.04","effect":null,"exec":null,"params":[{"name":"hashMap","type":"HashMap","optional":false,"default":null,"description":null,"types":["HashMap"],"since":null,"text":"hashMap: HashMap"}],"returns":{"type":"HashMap","types":["HashMap"],"description":"a new instance of the provided HashMap filled with the same key-value pairs ([deep copy](https://en.wikipedia.org/wiki/Object_copying#Deep_copy))","text":"HashMap - a new instance of the provided HashMap filled with the same key-value pairs ([deep copy](https://en.wikipedia.org/wiki/Object_copying#Deep_copy))"},"form":"unary","operator":"+","left":null,"right":{"text":"hashMap","types":["HashMap"]}}],"examples":[{"text":"```sqf\n 5 +  3    // returns  8\n-5 + -3    // returns -8\n```","code":[" 5 +  3\t// returns  8\n-5 + -3\t// returns -8"]},{"text":"```sqf\n+  2    // returns  2\n+ -7    // returns -7\n```","code":["+  2\t// returns  2\n+ -7\t// returns -7"]},{"text":"```sqf\n_arrayA = [1,2,3];\n_arrayB = [3,4,5];\n_arrayAB = _arrayA + _arrayB; // _arrayAB = [1,2,3,3,4,5]\n// _arrayA and _arrayB remain unchanged\n```","code":["_arrayA = [1,2,3];\n_arrayB = [3,4,5];\n_arrayAB = _arrayA + _arrayB; // _arrayAB = [1,2,3,3,4,5]\n// _arrayA and _arrayB remain unchanged"]},{"text":"```sqf\n_result = \"Hello\" + \" \" + \"there\"; // \"Hello there\"\n```","code":["_result = \"Hello\" + \" \" + \"there\"; // \"Hello there\""]},{"text":"```sqf\n_arrayA = [1,2,3];\n_arrayB = + _arrayA;\n_arrayB set [0, 99]; // _arrayA = [1,2,3], _arrayB = [99,2,3]\n```","code":["_arrayA = [1,2,3];\n_arrayB = + _arrayA;\n_arrayB set [0, 99]; // _arrayA = [1,2,3], _arrayB = [99,2,3]"]},{"text":"Shallow copy with `ARRAY + []`:\n\n```sqf\nprivate _subArray = [1, 2, 3];\nprivate _array1 = [_subArray, 1, 2, 3];\nprivate _array2 = _array1 + [];\n_array2 select 0 set [0, \"oops\"];\nhint str _subArray; // [\"oops\", 2, 3]\n```\n\nDeep copy with `+ ARRAY`:\n\n```sqf\nprivate _subArray = [1, 2, 3];\nprivate _array1 = [_subArray, 1, 2, 3];\nprivate _array2 = + _array1;\n_array2 select 0 set [0, \"oops\"];\nhint str _subArray; // [1, 2, 3]\n```","code":["private _subArray = [1, 2, 3];\nprivate _array1 = [_subArray, 1, 2, 3];\nprivate _array2 = _array1 + [];\n_array2 select 0 set [0, \"oops\"];\nhint str _subArray; // [\"oops\", 2, 3]","private _subArray = [1, 2, 3];\nprivate _array1 = [_subArray, 1, 2, 3];\nprivate _array2 = + _array1;\n_array2 select 0 set [0, \"oops\"];\nhint str _subArray; // [1, 2, 3]"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Operators","pushBack","append","merge"],"notes":[],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Arrays","Command Group: HashMap","Command Group: Math","Command Group: Strings","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}