Last active
August 8, 2022 15:04
-
-
Save pedro757/60939f7e1791bd91ab7caf40080d9c49 to your computer and use it in GitHub Desktop.
javascript - prettify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doStuff(text) { | |
return text | |
.toLocaleLowerCase() | |
.split(" ") | |
.reduce((prev, curr) => { | |
if (curr.length > 5) { | |
if (prev === "") return curr; | |
return curr + ", " + prev; | |
} | |
return prev; | |
}, "") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment