whats the difference between:
for _,v in pairs
and
for i,v in pairs
whats the difference between:
for _,v in pairs
and
for i,v in pairs
Just a different variable name, they are the same
_ is a blank global, you cannot use it
None, in the former example the index isn’t needed so the dummy variable _
is used. In the latter, it is being used so a more meaningful identifier is used.
(you should really search before posting too)
Basically there is no differences, “_” is normally used when the variable is not going to be used.
It can be used. The _
has no special meaning syntax-wise. It is still a valid identifier. Although the point of that is to not
When I attempt to print it in code, it will error
Oh wait, my bad, it actually screams at me that this is a placeholder
Yes that is the Luau linter
I know, I just forgot if it errored or warned
You didn’t just assign a value to an empty global… GUARDS! Get him!