# wrIsNonEmptyArray

> Type guard for an array with at least one element, so `[0]` is typed `T`.

Source: https://ngwr.dev/reference/utils/wr-is-non-empty-array  
Kind: Util  
Updated in v16  
Optional

## Usage

```angular-ts
import { wrIsNonEmptyArray } from 'ngwr/utils';

if (wrIsNonEmptyArray(rows)) {
  highlight(rows[0]); // Row, not Row | undefined
}
```

## API

| Name | Description | Type | Default |
| --- | --- | --- | --- |
| `wrIsNonEmptyArray(value)` | Narrows to `[T, ...T[]]`, so index 0 is not nullable. Accepts a `null` or `undefined` list too. | `<T>(value: WrMaybe<T[]>) => value is [T, ...T[]]` | `—` |

## See also

- [wrIsDefined](https://ngwr.dev/reference/utils/wr-is-defined) — Type guard that drops null and undefined, for use with Array.filter.
- [Common types](https://ngwr.dev/reference/interfaces/common) — Shared type aliases from ngwr/utils.
