---
title: "isArray"
description: "A TypeScript type guard that checks whether a value is an array, narrowing the type so you can safely access array methods in your code."
canonical_url: "https://core.mhaibaraai.cn/en/docs/validators/is-array"
---
# isArray

> A TypeScript type guard that checks whether a value is an array, narrowing the type so you can safely access array methods in your code.

## Usage

Check whether a value is an array. This is a TypeScript type guard function.

```ts
import { isArray } from '@movk/core'

isArray([]) // => true
isArray([1, 2]) // => true
isArray({}) // => false
```

## API

`isArray(value: any): value is any[]`

### Parameters

**value** (`any`) *required*: The value to check.

### Returns

**boolean**: Returns true if the value is an array, otherwise false.

## Changelog

See commit history for [src/validators/isArray.ts](https://github.com/mhaibaraai/movk-core/commits/main/src/validators/isArray.ts).

---

- [GitHub](https://github.com/mhaibaraai/movk-core/blob/main/src/validators/isArray.ts)


## Sitemap

See the full [sitemap](https://core.mhaibaraai.cn/sitemap.md) for all pages.
