Arrays
Array<T> is a fixed-size sequence of elements of the same type, where T represents the element type. Arrays are created using square brackets [] as literals, and the compiler automatically infers the element type.
Array elements are accessed by index, starting from 0. The .size property returns the number of elements. You can use a for-in loop to iterate through all elements in the array in order.
Although arrays cannot change their length (elements cannot be added or removed), you can modify the values at existing positions. Note that Array is a reference type—assigning or passing as a parameter does not copy the element data; multiple references point to the same data.
size - 1, otherwise a compile-time or runtime error will occur.Run the code to observe array creation, access, and modification. Try declaring a new variable pointing to numbers, modify it, and observe whether the original array changes.