Swan Lake Beta2 is here. ```import ballerina/io;

public function main() {
int[] v = [1, 2, 3];

// `v[i]` does indexed access.
int n = v;

io:println(n);

// `v[i]` is an `lvalue`.
v = 4;

// `len` will be 3.
int len = v.length();

}
```

## Arrays

`T[]` is an `array` of `T`. Arrays are mutable. `==` and `!=` on arrays is deep: two arrays are equal if they have the same members in the same order. Ordering is lexicographical based on the ordering of the members. Langlib `arr.length()` function gets the length; `arr.setLength(n)` sets the length.

``````import ballerina/io;
``````
``````public function main() {
int[] v = [1, 2, 3];
``````
``````    int n = v;
``````

`v[i]` does indexed access.

``````    io:println(n);
``````
``````    v = 4;
``````

`v[i]` is an `lvalue`.

``````    int len = v.length();
``````

`len` will be 3.

``````}
``````
``````bal run arrays.bal
1
``````
```import ballerina/io;

public function main() {
int[] v = [1, 2, 3];

// `v[i]` does indexed access.
int n = v;

io:println(n);

// `v[i]` is an `lvalue`.
v = 4;

// `len` will be 3.
int len = v.length();

}
```

## Arrays

`T[]` is an `array` of `T`. Arrays are mutable. `==` and `!=` on arrays is deep: two arrays are equal if they have the same members in the same order. Ordering is lexicographical based on the ordering of the members. Langlib `arr.length()` function gets the length; `arr.setLength(n)` sets the length.

``````import ballerina/io;
``````
``````public function main() {
int[] v = [1, 2, 3];
``````
``````    int n = v;
``````

`v[i]` does indexed access.

``````    io:println(n);
``````
``````    v = 4;
``````

`v[i]` is an `lvalue`.

``````    int len = v.length();
``````

`len` will be 3.

``````}
``````
``````bal run arrays.bal
1
``````

In the creation of Ballerina, we were inspired by so many technologies. Thank you to all that have come before us (and forgive us if we missed one): Java, Go, C, C++, D, Rust, Haskell, Kotlin, Dart, TypeScript, JavaScript, Python, Perl, Flow, Swift, Elm, RelaxNG, NPM, Crates, Maven, Gradle, Kubernetes, Docker, Envoy, Markdown, GitHub and WSO2.