Initialize an Array
Examples in
V
module main
fn main() {
numbers := [1, 2, 4, 5, 6, 7, 8, 9, 10]
println(numbers)
friends := ['Alex', 'Nedpals', 'Joe', 'Spytheman']
println(friends)
mut empty_numbers := []int{}
empty_numbers << 20
empty_numbers << 30
println(empty_numbers)
}
Last Run
:
[1, 2, 4, 5, 6, 7, 8, 9, 10]
['Alex', 'Nedpals', 'Joe', 'Spytheman']
[20, 30]