flatten: Difference between revisions

From Bohemia Interactive Community
m (Some wiki formatting)
mNo edit summary
 
Line 10: Line 10:
|s1= [[flatten]] array
|s1= [[flatten]] array


|p1= array: [[Array]]
|p1= array: [[Array]] of [[Anything]]


|r1= [[Array]] - flattened array
|r1= [[Array]] of [[Anything]] - flattened array


|x1= <sqf>flatten [1, [2], [[3]], [[[4]]]]; // returns [1, 2, 3, 4]</sqf>
|x1= <sqf>flatten [1, [2], [[3]], [[[4]]]]; // returns [1, 2, 3, 4]</sqf>

Latest revision as of 11:41, 1 January 2026

Hover & click on the images for description

Description

Description:
Flattens an array.
Groups:
Arrays

Syntax

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

Examples

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

Additional Information

See also:
arrayIntersect

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note