Created
February 2, 2020 18:37
-
-
Save jsmanifest/4ce3dfe921fc7bc1e8cdc1a133ab0cbc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 prefixWordWithUnderscore(word) { | |
return `_${word}` | |
} | |
const words = ['coffee', 'apple', 'orange', 'phone', 'starbucks'] | |
const prefixedWords = words.map(prefixWordWithUnderscore) | |
// result: ["_coffee", "_apple", "_orange", "_phone", "_starbucks"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment