Indexers

Define and implement indexers to enable array-like access to object data using custom logic and varied parameter types.

We'll cover the following...

Indexers are special constructs that allow us to access an object’s content through an index. They add an array-like behavior to custom types.

For example, to access the second item of an array, we use an index, 1: