Last active
January 29, 2019 13:09
-
-
Save Chuloo/b855d0e3815430d427be54cd022e9530 to your computer and use it in GitHub Desktop.
Join words in an array
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
// create new array | |
const newArray = ['a', 'new', 'array'] | |
// join array with no spaces | |
const simpleString = newArray.join('') | |
// join array with dashes | |
const dashedString = newArray.join('-') | |
// display new strings | |
console.log(simpleString) | |
console.log(dashedString) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment