Last active
August 4, 2022 21:28
-
-
Save Drex72/bb3cfaf3023e1a068b23b6741d6cc877 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
/* | |
Make the function more readable and maintainable | |
*/ | |
function doStuff(text) { | |
const words = text.toLocaleLowerCase().split(' ').reverse() | |
return words | |
.map((word) => word.trim()) | |
.filter((word) => word.length > 5) | |
.join(', ') | |
.slice(0, -2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment