FirstOfGroup

Parameters
whichGroup group
bug

If the first unit of this group was removed from the game (RemoveUnit or decayed) then null be returned, regardless if there're valid units in group at further indeces. To iterate over all existing units of a group, use ForGroup/ForGroupBJ. You cannot remove such null "holes" from a group without destroying or clearing it (DestroyGroup/GroupClear). If you use FirstOfGroup in iterations with removal, units in the group will eventually leak.

comment

Returns the unit at the first position in group or null if that unit no longer exists.

Equivalent to: BlzGroupUnitAt(varGroup, 0).

note

See GroupUtils Library for vJass.

return type
unit
Source code
native FirstOfGroup             takes group whichGroup returns unit
Source
group.j
wc3modding.com
FirstOfGroup