Creates a partial function which will always default to another value when non-values are passed to it.

This function is valid in v2.8.0 to v2.20.0. This function has been downloaded 22 times.


{*} defaultValue
Value to default to if the value passed to the partial function is not sufficient.
{boolean=} opt_beStrict Optional, Default:false
Specifies whether or not to only check if the value passed to the partial function is undefined.


A partial function which will return either the value passed in or defaultValue based on the following criteria: If opt_beStrict is true-ish and value is undefined, defaultValue will be returned. If opt_beStrict is false-ish and value is undefined, null or NaN, defaultValue will be returned. In all other cases value will be returned.

Required Function

This function requires the following function which is included automatically:

  • defaultTo()
    Defaults specific non-values to another given value.