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.
Saturday has the index 6. Jan 6, 2024 was a Saturday.
Challenge: Verify that new Date(2024, 0, 6).getDay() returns 6.