why it's printing intialized value after assigning new value to that property?

Viewed 39

I am new to swift.Why the value of a is printed zero here?

var a = 0

var b = 0

let closure = { [a] in

   print(a,b)

}

a = 10

b = 10

closure()
0 Answers
Related