BIS_fnc_consolidateArray

From Bohemia Interactive Community
Revision as of 14:23, 13 June 2021 by Lou Montana (talk | contribs) (Text replacement - " \|x([0-9])= *([^|]+) \}\}" to " |x$1=$2 |seealso= }}")
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Description needed
Execution:
call
Groups:
Arrays

Syntax

Syntax:
array call BIS_fnc_consolidateArray
Parameters:
array: Array - array of anything
Return Value:
Array - array of sub-arrays in format [[value, count],...], where:
  • value: Anything - consolidated element
  • count: Number - occurrence count

Examples

Example 1:
["apple","apple","pear","pear","apple"] call BIS_fnc_consolidateArray; // Return: [["apple",3],["pear",2]]
Example 2:
["apple","apple",1,1,nil,nil] call BIS_fnc_consolidateArray; // Return: [["apple",2],[1,2],[any,2]]

Additional Information

See also:
See also needed

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