DEV Community

Cover image for Swift Basic: Constants and Variable
Opeyemi Noah
Opeyemi Noah

Posted on

2 1

Swift Basic: Constants and Variable

A moment will come where you will need to store data, irrespective of the programming of your choice.

In swift there are two ways to do this ,

  1. Variable
  2. Constants

Whats a variable ?

Variable is a data store that can have its value changed anytime.

variable have value that can vary - Paul Hudson
"var" keyword is used to denote variable

Whats a Constant ?

Constant is a data store that cant have its value changed once it is set or specified.

constant have value that are constant (cannot be changed).
"let" keyword is used to denote constant.

Top comments (0)

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup πŸš€

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

πŸ‘‹ Kindness is contagious

Explore this insightful post in the vibrant DEV Community. Developers from all walks of life are invited to contribute and elevate our shared know-how.

A simple "thank you" could lift spiritsβ€”leave your kudos in the comments!

On DEV, passing on wisdom paves our way and unites us. Enjoyed this piece? A brief note of thanks to the writer goes a long way.

Okay