30 seconds of code

  Back to Home

isBeforeDate

dateutilitybeginner

Check if a date is before another date.

Use the less than operator (<) to check if the first date comes before the second one.

const isBeforeDate = (dateA, dateB) => dateA < dateB;