Back to Developer Roadmap

Constants & Variables

src/data/roadmaps/swift-ui/content/constants--variables@fdMCoxX_YjtgUReIGh1nn.md

4.0731 B
Original Source

Constants & Variables

Constants and variables are fundamental building blocks in Swift for storing data. A variable holds a value that can be changed during the execution of a program, while a constant holds a value that, once assigned, cannot be altered. They are declared using the var and let keywords, respectively, followed by the name you choose for the constant or variable and its data type.

Visit the following resources to learn more: