Created
July 2, 2022 13:29
-
-
Save timgarciaa/2db7763632ce8fcb7869deb47929eccb to your computer and use it in GitHub Desktop.
Combine string of array using reduce
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
const fruits = ['apple', 'orange', 'banana']; | |
const result = fruits.reduce((current, next) => current + ' ' + next, 'test '); | |
console.log(result); | |
// test apple orange banana |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment