Describe Any Date
JavaScript
20 pts
Describe Any Date
Write a function describe(date) that returns (not prints) a text like "Saturday, 14 March 2026" for any date: the weekday name, a comma, the day of the month, the month name and the year. Use the arrays days and months from the starter with getDay() and getMonth() as indexes. The three console.log lines must then print:
Saturday, 14 March 2026 Friday, 25 December 2026 Friday, 1 January 2027
Checklist
- Create the function
describe(date). - Return the weekday, day, month name and year for any date.
- Look up the names with
getDay()andgetMonth(). - Print the three dates.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
