What is difference between 'let' and 'var' declaration ?
Answer Posted / 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 |
Post New Answer View All Answers
What is set swift?
Which is better car baleno or swift?
What is type aliasing in swift?
What is a swift protocol?
Can any be nil swift?
Do swift classes inherit from nsobject?
How to create a constant in swift programming?
What are ui elements?
Explain me what is swift?
What is better swift or objective c?
What is swift module?
What is bridging header in swift?
What is the difference between nil and none in swift?
What is swift nsarray?
What is singleton class swift 3?