diff --git a/snippets/minDate.md b/snippets/minDate.md index 23cd10e76..1c6b0eebc 100644 --- a/snippets/minDate.md +++ b/snippets/minDate.md @@ -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