Guest User

Untitled

a guest
Jan 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. import Foundation
  2.  
  3.  
  4. var array = [1, 2, 3]
  5.  
  6. for number in array {
  7. print(number) // 1
  8. array = [4, 5, 6]
  9. }
  10. print(array) // 2
  11.  
  12. array.forEach { (number) in
  13. print(number) // 3
  14. array = [7, 8, 9]
  15. }
  16. print(array) // 4
  17.  
  18. /*
  19. Question: what will be printed?
  20. */
Add Comment
Please, Sign In to add comment