Created
May 26, 2020 11:02
-
-
Save tai-cha/c15429381b0aedb1d2b6514669d637a0 to your computer and use it in GitHub Desktop.
array to string sample
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
const strArray = ["This", "is", "test", "code", "to", "join", "string"]; | |
const arrayToString = (arr) => arr.reduce((acc, cur) => acc + " " + cur); | |
console.log(arrayToString(strArray)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment