Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:1.30

Description

Description:This function returns an array of elements resulting from addition of two passed arrays.

The originally passed arrays are not modified.

The function adds elements from arrays respective to their order. In case arrays are not of same size, the elements of the larger array that do not have corresponding element in smaller array will still get included in the resulting array.

Note: Only works with arrays containing numbers.

Syntax

Syntax:[array1, array2] call fn_vbs_arrayAdd
Parameters:
  • baseArray: Array - Array that is added to
  • addedArray: Array - Array to be added.
Return Value:Array

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
_array = [[0,1,2,3,4], [5,6,7,8,1]] call fn_vbs_arrayAdd
Returns: [5,7,9,11,5]
_array = [[0,1], [5,6,7,8,1]] call fn_vbs_arrayAdd
Returns: [5,7,7,8,1]

Additional Information

See also: fn vbs vectorAdd, fn vbs arrayInsert, fn vbs setEach
Multiplayer: 
Problems: 

Notes