It obtains the collection item based on the index. If the transferred index is greater than the number of items in the collection, then a new item is added at the index transferred. When the [] operator is used and the index is beyond the collection, an error occurs.