take this skript for an example:
command /killzombies:
trigger:
loop all zombies in world("world"):
kill loop-entity
send "&aAll zombies killed!"
It will loop all the zombies in the world with the name "world". Once it loops through all the zombies it forgets about the loop ever happening, not saving any information into the server memory.
Here's another example:
command /killzombies:
trigger:
loop all zombies in world("world"):
add loop-entity to {Zombies::*}
kill {Zombies::*}
clear {Zombies::*}
send "&aAll zombies killed!"
Once the loop is done in this skript, all the zombies will be saved into a variable, where only then will it get saved into a file (variables.csv). Then when it kills the zombies after the loop, it will then clear the variable, removing any data regarding the already dead zombies.