Add value or default

This commit is contained in:
Stefan Feješ
2017-12-13 08:34:42 +01:00
parent 6119b2566c
commit 203d646abc

View File

@ -0,0 +1,8 @@
### Value or default
Returns value, or default value if passed value is `falsy`.
```js
const valueOrDefault = (value, d) => value || d;
// valueOrDefault(NaN, 30) -> 30
```