What is difference between 'let' and 'var' declaration ?
Answer / iosraj
constants are expressed with the ‘let’ keyword. So once assigned value can not be change, but assigned values using 'var' keyword can be change.
In terms of objective -c or compare with objective -c, 'var' is Mutable and 'let' is NonMutable.
let kMyConstant = 40
Or
let kMyConstant: Int = 40
var myString = "This is my string."
| Is This Answer Correct ? | 0 Yes | 0 No |
Difference in classes and structures in swift?
What is bridging header in swift?
What is mutating keyword in swift?
What are delegates swift 4?
What is string in swift?
What is lazy var in swift?
What are structures in swift?
What are the control transfer statements used in swift?
Which compiler is used in swift?
Can you make a property optional?
What is observer in swift?
What is floating point number in swift?