parts of the day

PHOTO EMBED

Sat May 07 2022 10:39:24 GMT+0000 (UTC)

Saved by @Dyam #typescript

const partsOfTheDay = () => {
    let hour = new Date().getHours();
    let text = ["It's morning", "It's afternoon", "It's evening", "It's night"];
    var timeOfDay = text[hour < 12 ? 0 : hour < 18 ? 1 : hour < 22 ? 2 : 3];
    return timeOfDay;
}
content_copyCOPY