Are closures value or reference types? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 2

Are closures value or reference types?

2nd Jun 2020, 9:35 AM
Naiyan Noor
Naiyan Noor - avatar
1 ответ
+ 2
Closures are reference types. If you assign a closure to a variable and you copy the variable into another variable, you also copy a reference to the same closure and its capture list.
2nd Jun 2020, 9:53 AM
Justin