Home > @dinofe/xt-core > isDef

# isDef() function

是否为有效的值

Signature:

export declare function isDef(a: any): boolean;

# Parameters

Parameter Type Description
a any 待校验的数据

Returns:

boolean

判断结果

# Remarks

非 undefined | 'undefined' | null

# Example

import { isDef } from '@dinofe/xt-core/common'
isDef(undefined) // false
isDef('undefined') // false
isDef(null) // false
isDef('foo') // true