import { List } from 'immutable'; const mylist = List([1, 2, 3]); // Add a new element to the list const newList = mylist.push(4); console.log(newList); // [1, 2, 3, 4] // Retrieve an element at an index const element = mylist.get(0); console.log(element); // 1 // Get the size of the list const size = mylist.size; console.log(size); // 3In the example above, we create a List with three elements and perform some operations on it like adding a new element, getting an element at an index, and getting the size of the list. As we are using immutable lists, none of these operations mutate the original list. Instead, they return new lists with the necessary operations applied to them. The List implementation in TypeScript's immutable package provides a range of functions to manipulate lists in a safe and efficient manner. It is a powerful tool for any developer looking to write functional and immutable code.