Skip to content

Instantly share code, notes, and snippets.

@Chuloo
Last active January 29, 2019 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chuloo/b855d0e3815430d427be54cd022e9530 to your computer and use it in GitHub Desktop.
Save Chuloo/b855d0e3815430d427be54cd022e9530 to your computer and use it in GitHub Desktop.
Join words in an array
// 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