Methods
append(value) → {List}
Append value to list
Parameters:
Name | Type | Description |
---|---|---|
value |
any | Value to append to list |
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 |
Returns:
new list combining values of previous lists
- Type
- List
copy() → {List}
Create copy of the list instance
Returns:
new copy of list
- Type
- List
each(callback) → {List}
Run callback on each element of List
Parameters:
Name | Type | Description |
---|---|---|
callback |
eachCallback |
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 |
Returns:
instance of list for chaining
- Type
- List
find(callback) → {any}
Find element
Parameters:
Name | Type | Description |
---|---|---|
callback |
findCallback |
Returns:
found element
- Type
- any
first() → {any}
Get first element in list
Returns:
first element in list
- Type
- any
last() → {any}
Get last element in list
Returns:
last element in list
- Type
- any
pop() → {any}
Remove last element from list
Returns:
Removed element
- Type
- any
prepend(value) → {List}
Prepend value to list
Parameters:
Name | Type | Description |
---|---|---|
value |
any | Value to prepend to list |
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 |
Returns:
accumulated value
- Type
- any
shift() → {any}
Remove first element from list
Returns:
Removed element
- Type
- any
toArray() → {Array}
Create array from List
Returns:
elements of list in array
- Type
- Array
toString() → {string}
Create string from List
Returns:
string representation of list
- Type
- string