; to suppress output returned. For example let’s compare two codes with and without
; at the end.
x=2 would return
2 in the console as an output while
x=2; will not return anything in the console.
enumerate() returns both the index and the value of an element in an array.
(1, "Korea") (2, "Japan") (3, "China")
countries = ("Korea", "Japan", "China") for (index, country) in enumerate(countries) println("Country $(country) in index $(index)") end
Country Korea in index 1 Country Japan in index 2 Country China in index 3