Going through the Apple documentation for Swift, I'm designed a for loop that creates 5 buttons to act as "stars" in a 5-star rating feature.
I noticed that the for loop is constructed as follows:
for _ in 0...<5
And in the explanation for this, Apple mentions that you can use a wildcard _
operator when you don't need to know which iteration of the loop is currently executing.
But what's the upside to not knowing the iteration? Is it a memory saving issue optimization? Is there ever a scenario where you don't want to know the iteration?