Collection

Defines arrays of various formats and provides APIs for adding, deleting, and managing each array element.

Creates a new Module.Collection API.

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.

Name
Type
Description

element

object

Data to be added (sorted in order starting from 0).

  • Return

    • Total number of data after addition.

clear()

Deletes all data in the array.

  • Return

    • Total number of data after addition.

item(index) → object

Returns the data corresponding to the index number.

Name
Type
Description

index

number

Index of the data to return.

  • Return

    • Data corresponding to the index number.

Last updated