Constructor
Ordered, indexed, dense collections, like JavaScript Arrays.
Parameters:
Name | Type | Description |
---|---|---|
values |
Array | A plain Javascript array from which the list can be generated. |
Examples
Create a list from an array
const list = PSPDFKit.Immutable.List([1, 2]);
Add a new item to the end of the list
list = list.push(3); // => Immutable.List[1, 2, 3]
Remove an item by it's index
list = list.delete(0); // => Immutable.List[2, 3]
Modify all items in the list using an ES2015 arrow function
list = list.map(v => v * 2); // => Immutable.List[4, 6]
Reverse the List
list = list.reverse(); // => Immutable.List[6, 4]