FirstOfGroup

Parameters
whichGroup group
comment

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

Equivalent to: BlzGroupUnitAt(varGroup, 0).

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.

note

See GroupUtils Library for vJass.

patch

1.00

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