> ## Documentation Index > Fetch the complete documentation index at: https://www.canva.dev/docs/apps/llms.txt > Use this file to discover all available pages before exploring further. # List API reference for the List type. A list of items that can be read and updated. ## Type Parameters • **S** • **M** ## Methods Gets the number of items in the list. **Returns** The number of items. `number` Converts the list to an array. **Returns** An array containing all items. The items are the same as in the list. readonly `M`\[] Executes a function for each item in the list. **Parameters** The function to run for each item. **Parameters** The current item in the list. **Returns** `void` **Returns** `void` Creates a new array with items that match a specific type. **Parameters** A function that checks if an item is of type `C`. **Parameters** The item to test. **Returns** `true` if the item is of type `C`, otherwise `false`. `item is C` **Returns** An array of items that are of type `C`. readonly `C`\[] Creates a new array with items that pass a test. **Parameters** A function that tests each item. Returns `true` to keep the item. **Parameters** The item to test. **Returns** `true` if the item should be included, otherwise `false`. `boolean` **Returns** An array of items that passed the test. readonly `M`\[] Adds a copy of an item to the list and places it right before another item. **Parameters** The existing item to place the new item before. If `ref` is `undefined`, the new item is added at the end of the list. If `ref` does not exist in the list, the operation fails. The item to add. A copy of this item will be inserted. **Returns** The added item, or `undefined` if the operation failed. `M | undefined` Adds a copy of an item to the list and places it right after another item. **Parameters** The existing item to place the new item after. If `ref` is `undefined`, the new item is added at the start of the list. If `ref` does not exist in the list, the operation fails. The item to add. A copy of this item will be inserted. **Returns** The added item, or `undefined` if the operation failed. `M | undefined` Moves an existing item to a new position right before another item. **Parameters** The existing item to move the item before. If `ref` is `undefined`, the item is moved to the end of the list. If `ref` does not exist in the list, the operation fails. The item to move. The operation fails if the item is not already in the list. **Returns** `void` Moves an existing item to a new position right after another item. **Parameters** The existing item to move the item after. If `ref` is `undefined`, the item is moved to the end of the list. If `ref` does not exist in the list, the operation fails. The item to move. The operation fails if the item is not already in the list. **Returns** `void` Removes an item from the list. **Parameters** The item to remove from the list. **Returns** `void`