Sfârșitul zilei în JavaScript

Să obținem un obiect de tip dată care conține sfârșitul zilei curente:

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

Poate fi considerat sfârșitul zilei curente miezul nopții următoare (diferența este de 1 secundă):

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

După cum știți deja, zerourile în acest caz pot fi omise:

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

Apropo, miezul nopții va fi, de asemenea, ora 24:00:00 a zilei curente:

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

Să omitem zerourile:

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

Determinați câte ore au rămas până la sfârșitul zilei.