Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Swift
/
Closures
Three closures are appended inside for index in 0..<3 and invoked after the loop. Which c…
from Closures
Swift 6.3.3
intermediate
1 min
Three closures are appended inside for index in 0..<3 and invoked after the loop. Which capture description is correct?
Each closure retains its iteration binding, so the values are 0, 1, and 2.
All closures share one loop binding, so every value is 2.
Capturing an iteration binding is forbidden unless [index] is present.
Check
Ask AI about this kata
Report an error
previous kata
Spot the bug in the JobQueue
Spot the bug
A new version is available
Reload