Array Fields and Functions
let length: Int // Declare an array of integers.
let numbers = [42, 23, 31, 12]
// Find the number of elements of the array.
let length = numbers.length
// `length` is `4` fun concat(_ array: T): T // Declare two arrays of integers.
let numbers = [42, 23, 31, 12]
let moreNumbers = [11, 27]
// Concatenate the array `moreNumbers` to the array `numbers`
// and declare a new variable for the result.
//
let allNumbers = numbers.concat(moreNumbers)
// `allNumbers` is `[42, 23, 31, 12, 11, 27]`
// `numbers` is still `[42, 23, 31, 12]`
// `moreNumbers` is still `[11, 27]`Last updated