Methods
(static) add(list, item) → {Array}
Add item into array
Parameters:
Name | Type | Description |
---|---|---|
list |
Array | array to change |
item |
Midex | item to add |
Returns:
new array with new item inside
- Type
- Array
(static) addItemsToIndex(list, index, items) → {Array}
inject items into index without removing item at index
Parameters:
Name | Type | Description |
---|---|---|
list |
Array | array to change |
index |
Number | index in array |
items |
Array | items to inject |
Returns:
new array with injected items
- Type
- Array
(static) addToIndex(list, index, item) → {Array}
inject item into index without removing item at index
Parameters:
Name | Type | Description |
---|---|---|
list |
Array | array to change |
index |
Number | index in array |
item |
Mixed | item to inject |
Returns:
new array with injected items
- Type
- Array
(static) change(list, index, item) → {Array}
Replace item at index
Parameters:
Name | Type | Description |
---|---|---|
list |
Array | array to change |
index |
Number | index in array |
item |
Mixed | new item |
Returns:
new array with new item at index
- Type
- Array
(static) move(list, from, to) → {Array}
move item from index to new index
Parameters:
Name | Type | Description |
---|---|---|
list |
Array | array to change |
from |
Number | index in array |
to |
Number | index in array |
Returns:
new array with moved item
- Type
- Array
(static) remove(list, index) → {Array}
Remove item from array
Parameters:
Name | Type | Description |
---|---|---|
list |
Array | array to change |
index |
Number | index in array |
Returns:
new array without item at index inside
- Type
- Array
(static) resplaceItemsAtIndex(list, index, items) → {Array}
inject items into index with removing item at index
Parameters:
Name | Type | Description |
---|---|---|
list |
Array | array to change |
index |
Number | index in array |
items |
Array | items to inject |
Returns:
new array with injected items
- Type
- Array
(static) swap(list, index1, index2) → {Array}
swap items in array
Parameters:
Name | Type | Description |
---|---|---|
list |
Array | array to change |
index1 |
Number | index in array |
index2 |
Number | index in array |
Returns:
new array with swapped items
- Type
- Array