Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const greet = who =>
- `Good ${(({ E:e,PI:π }) =>
- (T => [...T, ...T])(['night', 'evening', 'afternoon', 'morning'])
- .reduceRight(
- (Π, λ, i) => [
- ...Π,
- ...(`${[λ, ''][i >-~ π | '']}$`
- .repeat(e +-~ i)
- .match(/\w+/g) || [])
- ], [])
- .slice(+true))(Math)[
- new Date().getHours()
- ]} ${who||''}`
- .trim();
- // example
- greet('you');
Add Comment
Please, Sign In to add comment