getDaybeginnerconst d = new Date(2024, 0, 15) // Monday
d.getDay() // β 1
// 0=Sun, 1=Mon, β¦, 6=SatUse getDay() to retrieve the day of the week (0 = Sunday through 6 = Saturday) in local time.
Returns the day of the week (0 = Sunday, 6 = Saturday). Jan 1, 2024 was a Monday.
Challenge: Verify that new Date(2024, 0, 1).getDay() returns 1 (Monday).