getDate is the day of the month; getDay is the weekday.
Acceptance criteria
- 1.#out should show Thursday.
getDate is the day of the month; getDay is the weekday.
const names = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; const date = new Date(Date.UTC(2026, 0, 15)); const name = names[date.getUTCDate()]; document.querySelector('#out').textContent = name === undefined ? "index out of range" : name;
Output ready when you are
Press Run to render your code, or Submit to validate your solution.