mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-07 04:53:12 +08:00
12 lines
308 B
TypeScript
12 lines
308 B
TypeScript
export const greeter = (): string => {
|
|
const now = new Date().getHours();
|
|
let msg: string;
|
|
|
|
if (now >= 18) msg = 'Good evening!';
|
|
else if (now >= 12) msg = 'Good afternoon!';
|
|
else if (now >= 6) msg = 'Good morning!';
|
|
else if (now >= 0) msg = 'Good night!';
|
|
else msg = 'Hello!';
|
|
|
|
return msg;
|
|
} |