Read the Exam Date
JavaScript
10 pts
Read the Exam Date
Abel’s maths exam is on 18 June 2026 at 9:45. The date is already in the variable exam. Use get methods to:
- create
year,month(as a normal month number, 1–12) andday(the day of the month); - print these four lines, reading the time with
getHours()andgetMinutes():
Year: 2026 Month: 6 Day: 18 Time: 9:45
Do not type the numbers yourself — read them from exam.
Checklist
- Create
year,month(1–12) anddaywith get methods. - Read the time with
getHours()andgetMinutes(). - Print the four lines exactly.
🔑 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.
