> For AI agents: the complete documentation index is available at https://massaman.dev/llms.txt, the full documentation bundle is available at https://massaman.dev/llms-full.txt.

# dropRepeats

Removes consecutively repeated elements from an array using strict
equality (`===`).

Only adjacent duplicates are removed — non-adjacent duplicates are kept.
Use `uniq` to remove all duplicates regardless of position.

Quirks (inherent to `===`):

- `NaN !== NaN`, so adjacent `NaN`s are _not_ collapsed.
- `-0 === 0`, so adjacent `-0` and `0` _are_ collapsed.
- Object/array elements compare by reference, not structure.

```typescript
dropRepeats([1, 1, 2, 3, 3, 2, 1])
// [1, 2, 3, 2, 1]
```

## Usage

### `dropRepeats<T>(array: readonly T[])`

Removes consecutively repeated elements from an array using strict
equality (`===`).

Only adjacent duplicates are removed — non-adjacent duplicates are kept.
Use `uniq` to remove all duplicates regardless of position.

Quirks (inherent to `===`):

- `NaN !== NaN`, so adjacent `NaN`s are _not_ collapsed.
- `-0 === 0`, so adjacent `-0` and `0` _are_ collapsed.
- Object/array elements compare by reference, not structure.

```typescript
import { dropRepeats } from 'massaman'
// or:  import { dropRepeats } from 'massaman/array'

dropRepeats([1, 1, 2, 3, 3, 2, 1])
// [1, 2, 3, 2, 1]
```

#### Parameters


arrayreadonly T[]required

the source array.

#### Returns

a new array with consecutive duplicate elements removed.

```typescript
T[]
```
