An open API service indexing awesome lists of open source software.

https://github.com/codewell/is-defined

Check if a value is defined
https://github.com/codewell/is-defined

Last synced: 29 days ago
JSON representation

Check if a value is defined

Awesome Lists containing this project

README

          

# @codewell/is-defined

## Intallation

```
npm install @codewell/is-defined
```

## Basic usage

```JavaScript
import { isDefined } from '@codewell/is-defined';

isDefined(undefined); // false
isDefined(null); // false
isDefined(NaN); // false

isDefined(1); // true
isDefined("foo"); // true
isDefined(() => {}); // true
isDefined([]); // true
isDefined({}); // true

isDefined(1, "foo", []) // => true
isDefined(1, "foo", null) // => false

isDefined() // Throws error

```