Guest practice: this set is not saved and does not count.
What does this log?
const a = new Date(2026, 0, 1); const b = new Date(2026, 0, 31); console.log(Math.round((b - a) / (1000 * 60 * 60 * 24)));
new Date("next Tuesday") throws a SyntaxError.
new Date("next Tuesday")
const d = new Date(Date.UTC(2026, 9, 2, 18, 30)); console.log(d.toISOString());
console.log(new Date(2028, 2, 0).getDate());
Adding days with date.setDate(date.getDate() + n) is safer than adding n * 24 * 60 * 60 * 1000 milliseconds, because of daylight saving changes.
date.setDate(date.getDate() + n)
n * 24 * 60 * 60 * 1000
Click a question to go back and check it. After you submit, you will see the right answer and an explanation for every question. As a guest, nothing is saved.
Check my answers