Update coalesce.md

This commit is contained in:
Angelos Chalaris
2017-12-18 12:16:18 +02:00
committed by GitHub
parent d7be9d9084
commit 1657b61417

View File

@ -1,6 +1,8 @@
### Coalesce a set of arguments
### coalesce
Use `find()` to return the first non null/undefined argument.
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(_))