Secondly,
and as the name of the unit, units?
print(units)
You will get something like:
{"creature_0", "creature_1", "creature_2", "creature_3"}
When we iterate through this table with a loop:
for i, unit in units do
then the variable unit already contains the name of one creature, for example, "creature_0". This is an internal name that the game assigned to the unit. In reality, it is slightly different. The best way to see this is to simply open the console during a battle and try the corresponding commands.