Get the last date in the month of a date
JavaScript
const getLastDate = (d = new Date()) => new Date(d.getFullYear(), d.getMonth() + 1, 0)
TypeScript
const getLastDate = (d = new Date()): Date => new Date(d.getFullYear(), d.getMonth() + 1, 0)
const getLastDate = (d = new Date()) => new Date(d.getFullYear(), d.getMonth() + 1, 0)
const getLastDate = (d = new Date()): Date => new Date(d.getFullYear(), d.getMonth() + 1, 0)