Weekday and Countdown
JavaScript
20 pts
Weekday and Countdown
Write two functions:
dayName(date)returns the weekday as a word, e.g."Thursday"(use the arraydayNamesandgetDay()).daysBetween(a, b)returns the number of whole days from dateato dateb(subtract, divide by the milliseconds of one day, and useMath.round).
Expected output:
Tuesday Saturday 39
Checklist
dayName(date)returns the weekday as a word.daysBetween(a, b)returns whole days.- Print the two weekdays and the number of days.
🔑 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.
