# Vector2:apply

Create a new vector by applying a function to each element of the current vector.

## Function

### Synopsis

```
result = Vector2:apply(f)
```

### Arguments

`function f`

- The function to apply to each element. It can take up to 2 arguments, with the first being the element value and the second being the element index.

### Returns

`Vector2 result`

- The result of applying the function
`f`

to each element of the vector.