flatten: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
m (Text replacement - " " to " ")
Line 13: Line 13:


|r1= [[Array]] - flattened array
|r1= [[Array]] - flattened array
 
 
|x1= <code>[[flatten]] [1, [2], <nowiki>[[3]]</nowiki>, [[[4]]]]; {{cc|returns [1, 2, 3, 4]}}</code>
|x1= <code>[[flatten]] [1, [2], <nowiki>[[3]]</nowiki>, [[[4]]]]; {{cc|returns [1, 2, 3, 4]}}</code>



Revision as of 21:01, 10 June 2021

Hover & click on the images for description

Description

Description:
Flattens an array.
Groups:
Arrays

Syntax

Syntax:
flatten array
Parameters:
array: Array
Return Value:
Array - flattened array

Examples

Example 1:
flatten [1, [2], [[3]], [[[4]]]]; // returns [1, 2, 3, 4]
Example 2:
flatten getUnitLoadout player;

Additional Information

See also:
arrayIntersect

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