isEmpty
object Object
Usage
Check whether a value is empty. The following values are considered empty:
nullundefined- empty string (
'') - empty array (
[]) - empty object (
{})
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
No recent changes