append: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 30: Line 30:


}}
}}
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on March 9, 2015 - 00:41 (UTC)</dd>
<dt class="note">[[User:Heeeere's Johnny!|Heeeere's Johnny!]]</dt>
<dd class="note">
<code>_array1 [[append]] _array2</code> is roughly 1.2x faster (depending on array size) than <code>_array1 <nowiki>=</nowiki> _array1 + _array2</code>(Averaged over 10.000 iterations with two identical arrays containing the numbers 0 through 9)<br />
The larger the arrays to append, the faster [[append]] is as it does not create a new array, which happens with array addition.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 01:41, 9 March 2015


Hover & click on the images for description

Description

Description:
Appends array2 to the back of array1 modifying array1.
Groups:
Uncategorised

Syntax

Syntax:
array1 append array2
Parameters:
array1: Array
array2: Array
Return Value:
Nothing

Examples

Example 1:
_arr = [1,2,3]; _arr append [4,5,6]; hint str _arr; //[1,2,3,4,5,6]

Additional Information

See also:
setpushBackresizereversecountfindinforEachdeleteAtdeleteRangeBIS_fnc_arrayPushStackBIS_fnc_arrayPush

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
Posted on March 9, 2015 - 00:41 (UTC)
Heeeere's Johnny!
_array1 append _array2 is roughly 1.2x faster (depending on array size) than _array1 = _array1 + _array2(Averaged over 10.000 iterations with two identical arrays containing the numbers 0 through 9)
The larger the arrays to append, the faster append is as it does not create a new array, which happens with array addition.