This commit is contained in:
Angelos Chalaris
2017-12-27 11:02:46 +02:00
parent 37bb271221
commit 3d79413392
45 changed files with 89 additions and 91 deletions

View File

@ -5,6 +5,6 @@ Returns the first non-null/undefined argument.
Use `Array.find()` to return the first non `null`/`undefined` argument.
```js
const coalesce = (...args) => args.find(_ => ![undefined, null].includes(_))
const coalesce = (...args) => args.find(_ => ![undefined, null].includes(_));
// coalesce(null,undefined,"",NaN, "Waldo") -> ""
```