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.
getDay() always returns an integer from 0 (Sunday) to 6 (Saturday).
Challenge: Verify that the result is in the range [0, 6].