const date = new Date();
const firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
console.log(firstDay.toDateString());
console.log(lastDay.toDateString());
/*
run:
"Tue Mar 01 2022"
"Thu Mar 31 2022"
*/