flatten: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (renamed)
(examples)
Line 15: Line 15:
| [[Array]] - Flattened array|RETURNVALUE=
| [[Array]] - Flattened array|RETURNVALUE=
   
   
|x1= <code>Will be added later</code> |EXAMPLE1=
|x1= <code>[[flatten]] [ 1, [2], <nowiki>[[3]]</nowiki>, [[[4]]] ];{{cc|Returns [1, 2, 3, 4]}}</code> |EXAMPLE1=
 
|x2= <code>[[flatten]] [[getUnitLoadout]] [[player]];</code> |EXAMPLE2=


| [[arrayIntersect]] |SEEALSO=
| [[arrayIntersect]] |SEEALSO=
}}
}}

Revision as of 16:17, 3 December 2020

-wrong parameter ("arma3dev") defined!-[[:Category:Introduced with arma3dev version 2.01|2.01]]
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

[[Category:Introduced with arma3dev version 2.01]][[ Category: arma3dev: New Scripting Commands | FLATTEN]][[ Category: arma3dev: Scripting Commands | FLATTEN]]