fix: simplify minDate implementation

This commit is contained in:
Christian C. Salvado
2019-06-12 11:15:33 -06:00
parent 0e9c5969d9
commit 40051c15fc

View File

@ -2,10 +2,10 @@
Returns the minimum of the given dates.
Use `Math.min.apply()` to find the minimum date value, `new Date()` to convert it to a `Date` object.
Use the ES6 spread syntax to find the minimum date value, `new Date()` to convert it to a `Date` object.
```js
const minDate = (...dates) => new Date(Math.min.apply(null, ...dates));
const minDate = dates => new Date(Math.min(...dates));
```
```js