final
This commit is contained in:
		
							
								
								
									
										10
									
								
								task4/greeting.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								task4/greeting.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| let currentDate = new Date(); | ||||
|  | ||||
| global.date = currentDate; | ||||
|  | ||||
| module.exports.getMessage = function () { | ||||
|     let hour = currentDate.getHours(); | ||||
|     if (hour > 16) return 'Добрый вечер, ' + global.name; | ||||
|     else if (hour > 10) return 'Добрый день, ' + name; | ||||
|     else return 'Доброе утро, ' + name; | ||||
| }; | ||||
		Reference in New Issue
	
	Block a user
	 kogleee
					kogleee