# 配列の関数

## `repeat`

構文

```go
array.repeat(number type)
```

配列の要素を指定の回数だけ繰り返します。

```go
foo := [1, 2].repeat(5)
println(foo) // [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]
```

## `delete`

構文

```go
array.delete(ix type)
```

インデックス`ix`の位置にある要素を配列から削除します。

Deletes the element present in the array at index `ix`.

```go
mut even_numbers := [2, 4, 6, 8, 10]
even_numbers.delete(3)
println(even_numbers) // [2, 4, 6, 10]
```

## `reverse`

構文

```go
array.reverse()
```

逆順の配列を返します。

```go
float_num := [1.1, 1.3, 1.25, 1.4]
float_num.reverse() // [1.4, 1.25, 1.3, 1.1]
```

## `clone`

構文

```go
array.clone()
```

配列を複製して新しい配列を返します。

```go
foo := [1, 2, 4, 5, 4, 6]
foo1 := foo.clone()
println(foo1) // [1, 2, 4, 5, 4, 6]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://v-community.gitbook.io/v-by-example/jp/examples/section_4/array-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
