I am currently doing a course for Swift.
While trying to write a simple while loop like the following:
var counter = 0
while counter < 10 {
counter += 1
print(counter)
}
This just returns on console 0, 0, 0, 0... non stop. So the programs doesn't add 1 to the counter, and consequently does not stop when counter < 10.
Why does this happen? I also tried to change it with:
counter = counter + 1
but the situation does not change. I leave a screenshot of my Playground