Skip to content

Instantly share code, notes, and snippets.

@douglogue
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglogue/a2caeac6a509039afba8 to your computer and use it in GitHub Desktop.
Save douglogue/a2caeac6a509039afba8 to your computer and use it in GitHub Desktop.
// vars
var mutableBeverage = "Leffe"
println(mutableBeverage) // "Leffe"
mutableBeverage = "Bud"
println(mutableBeverage) // "Bud"
mutableBeverage = mutableBeverage + "weiser"
println(mutableBeverage) // "Budweiser"
// lets
let immutableBeverage = "Bud"
println(immutableBeverage) // "Bud"
immutableBeverage = "Leffe" // Compiler error
immutableBeverage = immutableBeverage + "weiser" // Compiler error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment