just.defaults(value, defaultValueopt, opts) → {value}
Defaults to defaultValue if value looks like defaultValue.
- Source:
- defaults.js, line 59
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
value | Any | Any value. | ||||||||||||||||||||
defaultValue [optional] | Any | A value with a desired type for value. If an object literal is given, all the keys of value will default to his corresponding key in this object. | ||||||||||||||||||||
opts | object | Some options.Properties
|
Returns:
value if it looks like defaultValue or defaultValue otherwise.
- Type
- value