DEV Community

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

Posted on

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)