Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 397 Bytes

isSameDate.md

File metadata and controls

16 lines (12 loc) · 397 Bytes
title tags
isSameDate
date,beginner

Check if a date is the same as another date.

  • Use Date.prototype.toISOString() and strict equality checking (===) to check if the first date is the same as the second one.
const isSameDate = (dateA, dateB) => dateA.toISOString() === dateB.toISOString();
isSameDate(new Date(2010, 10, 20), new Date(2010, 10, 20)); // true