# Locator

Unlike [Position](https://alex-myznikov.gitbook.io/adsjs/api/position), the Locator class instance is stored directly in the data structure (which is array in this case) and used to propagate changes of the element's placement in result of operations. Without it you would lost the index of particular element in the array as soon as it been tossed somehow and had to look up for it again in O(n) instead of constant time access with locator.

### element

```typescript
element: T
```

Element represented by this locator. This field is read only.

#### Generic types (only for TS):

*T* - Type of elements stored in the data structure this locator belongs to.

### index

```typescript
index: number
```

Index of the element in its containing array. This field is read only.

{% hint style="danger" %}
Do not use `_internal` property from your code. It stays `public` because is used by external code in the package realization. But TS does not yet have `package` scope limitation level so this seems to be the only option.
{% endhint %}
