setDatebeginnerconst d = new Date(2024, 0, 15)
d.setDate(1)
d.getDate() // β 1Use setDate() to mutate the day-of-month of a Date object in place and get back the updated timestamp.
Day 28 is valid for all months.
Challenge: Verify that after setDate(28), getDate() returns 28.