From 40051c15fc5e5d2cea3cd4b3c99ff250aa2af72f Mon Sep 17 00:00:00 2001 From: "Christian C. Salvado" Date: Wed, 12 Jun 2019 11:15:33 -0600 Subject: [PATCH] fix: simplify minDate implementation --- snippets/minDate.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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