---
title: "isEmpty"
description: "[object Object]"
canonical_url: "https://core.mhaibaraai.cn/en/docs/validators/is-empty"
---
# isEmpty

> [object Object]

## Usage

Check whether a value is empty. The following values are considered empty:

- `null`
- `undefined`
- empty string (`''`)
- empty array (`[]`)
- empty object (`{}`)

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

isEmpty(null) // => true
isEmpty('') // => true
isEmpty([]) // => true
isEmpty({}) // => true

isEmpty(0) // => false
isEmpty('hello') // => false
isEmpty([1]) // => false
```

## API

`isEmpty(value: any): boolean`

### Parameters

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

### Returns

**boolean**: Returns true if the value is considered empty, otherwise false.

## Changelog

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


## Sitemap

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