default-to
v0.9.6arrow_drop_downv0.9.6
STATUS
Passing
DOWNLOADS
4
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
806 B
Returns the second argument if it is not `null`, `undefined` or `NaN`;
otherwise the first argument is returned.
1 contributor
Like
Install default-to as a package?
Copied
npm i @bit/justin-capalbo.ramda.default-to
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
defaultTo (
default:
a
,val:
) : b
*
Returns the second argument if it is not null
, undefined
or NaN
;
otherwise the first argument is returned.
Example
Arguments
default:
a
The default value.
val:
b
val
will be returned instead of default
unless val
is null
, undefined
or NaN
.
Returns
*
The second value if it is not `null`, `undefined` or `NaN`, otherwise the default value