This commit is contained in:
kogleee
2023-11-08 13:17:48 +03:00
commit 3dbd9654c2
136 changed files with 14736 additions and 0 deletions

9
task2/3/greeting.js Normal file
View File

@@ -0,0 +1,9 @@
let currentDate = new Date();
module.exports.date = currentDate;
module.exports.getMessage = function (name) {
let hour = currentDate.getHours();
if (hour > 16) return 'Добрый вечер, ' + name;
else if (hour > 10) return 'Добрый день, ' + name;
else return 'Доброе утро, ' + name;
};