From 1fbbf52a4db3b77f759291444b3cbee772387d35 Mon Sep 17 00:00:00 2001 From: Isabelle Viktoria Maciohsek Date: Wed, 7 Oct 2020 21:12:41 +0300 Subject: [PATCH] Update daysAgo.md --- snippets/daysAgo.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snippets/daysAgo.md b/snippets/daysAgo.md index 738696050..bba258fd7 100644 --- a/snippets/daysAgo.md +++ b/snippets/daysAgo.md @@ -10,9 +10,9 @@ Returns the date of `n` days ago from today as a string representation. ```js const daysAgo = n => { - let t = new Date(); - t.setDate(t.getDate() - Math.abs(n)); - return t.toISOString().split('T')[0]; + let d = new Date(); + d.setDate(d.getDate() - Math.abs(n)); + return d.toISOString().split('T')[0]; }; ```