Classes
Methods
(static) get(obj, optname, defvalue, allowNullopt, isLazyopt, lazyThisopt, lazyArgsopt) → {*}
See if a property in an object is set.
If it is, return the property, otherwise return a default value.
This uses the val()
method, and as such supports the same options.
However read the parameters carefully, as the defaults may be different!
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
obj |
object | An object to test for a property in. |
||
optname |
string | The property name we're checking for. |
||
defvalue |
* | The default value. |
||
allowNull |
bool |
<optional> |
true | Same as |
isLazy |
bool |
<optional> |
false | Same as |
lazyThis |
object |
<optional> |
opts | Same as |
lazyArgs |
Array |
<optional> |
Same as |
Returns:
Either the property value, or the default value.
- Type
- *
(static) val(optvalue, defvalue, allowNullopt, isLazyopt, lazyThisopt, lazyArgsopt) → {*}
See if a value is set, and if not, return a default value.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
optvalue |
* | The value we are testing. |
||
defvalue |
* | The default value if opt was null or undefined. |
||
allowNull |
boolean |
<optional> |
false | If true, allow null to count as set. |
isLazy |
boolean |
<optional> |
false | If true, and |
lazyThis |
object |
<optional> |
null | If |
lazyArgs |
Array |
<optional> |
If |
Returns:
Either the specified opt
value or the default value.
- Type
- *