End of the day in JavaScript

Let's get a date object containing the end of the current day:

javascriptlet now  = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59);

You can consider the end of the current day as midnight of the next (difference is 1 second):

javascriptlet now  = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1, 0, 0, 0);

As you already know, zeros can be omitted in this case:

javascriptlet now  = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);

By the way, midnight will also be the time 24:00:00 of the current day:

javascriptlet now  = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 24, 0, 0);

Omit the zeros:

javascriptlet now  = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 24);
Задание 1

Determine how many hours are left before the end of the day.