diff --git a/snippets/maxDate.md b/snippets/maxDate.md index ffa784528..4b66adb94 100644 --- a/snippets/maxDate.md +++ b/snippets/maxDate.md @@ -2,10 +2,10 @@ Returns the maximum of the given dates. -Use `Math.max.apply()` to find the maximum date value, `new Date()` to convert it to a `Date` object. +Use the ES6 spread syntax with `Math.max` to find the maximum date value, `new Date()` to convert it to a `Date` object. ```js -const maxDate = (...dates) => new Date(Math.max.apply(null, ...dates)); +const maxDate = dates => new Date(Math.max(...dates)); ``` ```js