Class: List

List()

List Class

Constructor

new List()

Source:

Members

isEmpty

Returns true/false if list is empty
Source:

size

Returns number of elements
Source:

Methods

add(val, idxopt)

Add a new value to the end list, unless index is provided
Parameters:
Name Type Attributes Default Description
val any
idx number <optional>
null
Source:

clear()

Clears the list
Source:

contains(val) → {boolean}

Returns true/false if list contains value
Parameters:
Name Type Description
val any
Source:
Returns:
Type
boolean

get(idxopt)

Retrieves the list starting from index idx, if not provided retrieves head of list
Parameters:
Name Type Attributes Default Description
idx number <optional>
null
Source:

remove(idxopt)

Remove the value at index idx, if not provided removes the last element of the list
Parameters:
Name Type Attributes Default Description
idx number <optional>
null
Source:

subList(start, end) → {boolean}

Returns a new list created from start,end indexes
Parameters:
Name Type Description
start number
end number
Source:
Returns:
Type
boolean

toArray() → {Array}

Converts and return an array from list
Source:
Returns:
Type
Array