Files
30-seconds-of-code/snippets/isSameDate.md
2018-09-29 13:58:38 +03:00

301 B

isSameDate

Check if a date is the same as another date.

Use strict equality checking (===) to check if the first date is the same as the second one.

const isSameDate = (dateA, dateB) => dateA === dateB;
isSameDate(new Date(2010, 10, 20), new Date(2010, 10, 20)); // true