Checks if a given value is defined or not.
isDefined(null)// =>falseisDefined(undefined)// => falseisDefined(NaN)// =>falseisDefined(true)// => trueisDefined(false)// => trueisDefined(0)// => trueisDefined(111)// => trueisDefined('')// => trueisDefined('message')// => trueisDefined([])// => trueisDefined({})// => trueisDefined({ message: 'hello' })// => trueisDefined(function () {}))// => true Copy
isDefined(null)// =>falseisDefined(undefined)// => falseisDefined(NaN)// =>falseisDefined(true)// => trueisDefined(false)// => trueisDefined(0)// => trueisDefined(111)// => trueisDefined('')// => trueisDefined('message')// => trueisDefined([])// => trueisDefined({})// => trueisDefined({ message: 'hello' })// => trueisDefined(function () {}))// => true
The type of the input value.
The value to be checked for definedness.
true if the given value is defined, and false otherwise.
true
false
Generated using TypeDoc v0.24.7
Checks if a given value is defined or not.
Example