Skip to content

Instantly share code, notes, and snippets.

@yannbertrand
Last active April 6, 2017 13:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yannbertrand/c2e8776fb3f0ada0b9bc to your computer and use it in GitHub Desktop.
Save yannbertrand/c2e8776fb3f0ada0b9bc to your computer and use it in GitHub Desktop.
How to implode/explode an array in JS?
// explode -> .split
console.log(['Hello', 'World'].join()) // ',' is optional
// → "Hello,World"
// implode -> .join
console.log('Hello,World'.split(','))
// → Array [ "Hello", "World" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment