GulfOfMexico
GulfOfMexico copied to clipboard
Add the let keyword
Use the let keyword to automatically determine which declaration to use.
let name = "Luke"! // const const
let name2 = "Lu"! // const var
name2.push("k")!
name2.push("e")!
let famous_cellular_automata = "The game of living"! // var const
famous_cellular_automata = "Conway's game of life"!
let language = "Spanish"! // var var
language = "English."!
language.pop()
Neat. Now we can use let with const and var to ensure the automatic declaration is choosing the right one :
let name = "Luke"! // const const
let var name = "Luke"! // Error : name is const