# Collection

> Creates a new Module.Collection API.

```javascript
var data_array = new Module.Collection();
```

## properties

| Name  | Type   | Description                     |
| ----- | ------ | ------------------------------- |
| count | number | Number of elements in the array |

### add(element) → number

> Adds new data to the array.

{% tabs %}
{% tab title="Information" %}

| Name    | Type   | Description                                         |
| ------- | ------ | --------------------------------------------------- |
| element | object | Data to be added (sorted in order starting from 0). |

* Return
  * Total number of data after addition.
    {% endtab %}

{% tab title="Template" %}

```javascript
var movePosition = new Module.Collection();
movePosition.add(new Module.JSVector3D(126.77599416643791, 35.02714918251881, 34.293371013365686));
movePosition.add(new Module.JSVector3D(126.78374897355015, 35.03318059967435, 35.54886215366423));
movePosition.add(new Module.JSVector3D(126.79212321528658, 35.03203801070689, 25.686076117679477));
movePosition.add(new Module.JSVector3D(126.79408620811664, 35.019259090964134, 29.999966450035572));
```

{% endtab %}
{% endtabs %}

### clear()

> Deletes all data in the array.

{% tabs %}
{% tab title="Information" %}

* Return
  * Total number of data after addition.
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### item(index) → object

> Returns the data corresponding to the index number.

{% tabs %}
{% tab title="Information" %}

| Name  | Type   | Description                  |
| ----- | ------ | ---------------------------- |
| index | number | Index of the data to return. |

* Return
  * Data corresponding to the index number.
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}
