Last active
August 4, 2021 14:42
-
-
Save wptechprodigy/94aee9c38af27dc87f79cbb2607aeb5f to your computer and use it in GitHub Desktop.
DayOne - Variables and Types in Swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// MARK: - VARIABLES | |
/* | |
Variables are data stored that can have their value change whenever we want it and | |
constant are value that can not be changed. | |
The advantage of using var in declaring a variable and let in declaring a constant is that | |
it help xcode to remind us of the constant we have set and whenever we try to change it, | |
it will not xcode will not compile our code and it help to save memory space that is optimization of memory. | |
*/ | |
// Declaring a variable | |
var name: String = "Christopher" | |
// Updating the variable | |
name = "Fortune" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
noted sir.....thanks a million