Class: List

List

new List()

Create instance of List
Source:

Methods

append(value) → {List}

Append value to list
Parameters:
Name Type Description
value any Value to append to list
Source:
Returns:
Instance of list for chaining
Type
List

concat(list) → {List}

Concat list with second list
Parameters:
Name Type Description
list List second list to concat
Source:
Returns:
new list combining values of previous lists
Type
List

copy() → {List}

Create copy of the list instance
Source:
Returns:
new copy of list
Type
List

each(callback) → {List}

Run callback on each element of List
Parameters:
Name Type Description
callback eachCallback
Source:
Returns:
instance of list for chaining
Type
List

extend(list) → {List}

Extend list with all values of array or list
Parameters:
Name Type Description
list List | Array values to add to list
Source:
Returns:
instance of list for chaining
Type
List

find(callback) → {any}

Find element
Parameters:
Name Type Description
callback findCallback
Source:
Returns:
found element
Type
any

first() → {any}

Get first element in list
Source:
Returns:
first element in list
Type
any

last() → {any}

Get last element in list
Source:
Returns:
last element in list
Type
any

pop() → {any}

Remove last element from list
Source:
Returns:
Removed element
Type
any

prepend(value) → {List}

Prepend value to list
Parameters:
Name Type Description
value any Value to prepend to list
Source:
Returns:
Instance of list for chaining
Type
List

reduce(callback, init) → {any}

Reduct List to single value
Parameters:
Name Type Description
callback reduceCallback
init any initial value for accumulation
Source:
Returns:
accumulated value
Type
any

shift() → {any}

Remove first element from list
Source:
Returns:
Removed element
Type
any

toArray() → {Array}

Create array from List
Source:
Returns:
elements of list in array
Type
Array

toString() → {string}

Create string from List
Source:
Returns:
string representation of list
Type
string