Javascript checks the given date is weekday

Function that checks the given date is weekday or not.

Snippet

const isWeekday = (date: Date): boolean => date.getDay() % 6 !== 0;

isWeekday(new Date(2022, 2, 21)); // -> true
isWeekday(new Date(2021, 2, 20)); // -> false