Skip to content

Instantly share code, notes, and snippets.

@cooler333
Last active November 19, 2018 11:51
Show Gist options
  • Save cooler333/55477faf1a2c948cd322069cb5fa1a55 to your computer and use it in GitHub Desktop.
Save cooler333/55477faf1a2c948cd322069cb5fa1a55 to your computer and use it in GitHub Desktop.
import Foundation
var array = [1, 2, 3]
for number in array {
print(number) // 1
array = [4, 5, 6]
}
print(array) // 2
array.forEach { (number) in
print(number) // 3
array = [7, 8, 9]
}
print(array) // 4
/*
Question: what will be printed?
*/
@cooler333
Copy link
Author

проверить

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment