Sobes.tech
Junior — Senior

What text will appear in the console

livecode

Task condition

This example demonstrates how variable capture works in Swift closures. Pay attention to the capture list and the change of the variable's value after the closure is created.

var number = 5
let display = { [number] in 
    print("Value \(number)")
}
number = 2
display()