Check if a date is a weekend
JavaScript version
// `date` is a Date object
const isWeekend = (date = new Date()) => date.getDay() % 6 === 0;
TypeScript version
const isWeekend = (date = new Date()): boolean => date.getDay() % 6 === 0;
JavaScript version
// `date` is a Date object
const isWeekend = (date = new Date()) => date.getDay() % 6 === 0;
TypeScript version
const isWeekend = (date = new Date()): boolean => date.getDay() % 6 === 0;