GulfOfMexico icon indicating copy to clipboard operation
GulfOfMexico copied to clipboard

Add the let keyword

Open i-cm opened this issue 4 months ago • 1 comments

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()

i-cm avatar Aug 07 '25 04:08 i-cm

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

Aluriak avatar Aug 20 '25 12:08 Aluriak