// Practice Set · JS Dates · guest

Guest practice: this set is not saved and does not count.

Question 1 of 5 from: JS Dates

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)));
Question 2 of 5 from: JS Dates

new Date("next Tuesday") throws a SyntaxError.

Question 3 of 5 from: JS Date Formats

What does this log?

const d = new Date(Date.UTC(2026, 9, 2, 18, 30));
console.log(d.toISOString());
Question 4 of 5 from: JS Date Set

What does this log?

console.log(new Date(2028, 2, 0).getDate());
Question 5 of 5 from: JS Date Set

Adding days with date.setDate(date.getDate() + n) is safer than adding n * 24 * 60 * 60 * 1000 milliseconds, because of daylight saving changes.

Ready to submit?

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.