Constants and variables must be defined prior to using them. To define a constant, you use the keyword
let, and to define a variable, you use the keyword
var. The following are some examples of constants and variables:
// Constants let freezingTemperatureOfWaterCelsius = 0 let speedOfLightKmSec = 300000 // Variables var currentTemperature = 22 var currentSpeed = 55
We can declare multiple constants or variables in a single line by separating them with a comma. For example, we could shrink the preceding four lines of code down to two lines like this:
// Constants let freezingTempertureOfWaterCelsius = 0, speedOfLightKmSec = 300000 // Variables var currentTemperture = 22, currentSpeed = 55
We can change the value of ...