Phone API Reference - Extended - util.isUndef
Desk Phone API features described in this section are deprecated and supported only on the following models: D40, d45, d50, d60, d62, d65, d70
util.isUndef
Description
Returns true if the supplied variable is undefined, false if it is defined.
Basic Example:Â
util.isUndef(var);
Note: if the variable you are testing has not been declared in anyway, this will throw an exception. If it has been declared but iniitalized as undefined (e.g,. not set in any way), the code with process.
Parameters
Name | Required | Type | Default | Description |
---|---|---|---|---|
var | Yes | variable | Â | Variable to be checked for definition. |
Â
Examples
util.isUndef returns true or false
var declaredUndef;
var str = 'foo';
var obj = {'test1' : 'abc'};
util.isUndef(str);Â // returns false
util.isUndef(obj.test1);Â Â Â // returns false
util.isUndef(obj.test2);Â Â Â // returns true
util.isUndef(declaredUndef); // true
util.isUndef(nonDeclaredVariable); // throws exception |
Â