iOS Swift - Swift Language Essentials
Consider this Swift code:
What will be printed and why?
var x = 5 let y = x x = 10 print(y)
What will be printed and why?
var x = 5 let y = x x = 10 print(y)
x is 5 initially. y is a constant assigned the current value of x, which is 5.x to 10 does not affect y, because y holds its own copy of the value 5.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions