Update coalesce.md
This commit is contained in:
@ -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
|
```js
|
||||||
const coalesce = (...args) => args.find(_ => ![undefined, null].includes(_))
|
const coalesce = (...args) => args.find(_ => ![undefined, null].includes(_))
|
||||||
|
|||||||
Reference in New Issue
Block a user