Skip to content

Instantly share code, notes, and snippets.

@goodbedford
Created April 2, 2016 14:07
Show Gist options
  • Select an option

  • Save goodbedford/c2d5fabe5908cd2e5cb8b50dee86e6d5 to your computer and use it in GitHub Desktop.

Select an option

Save goodbedford/c2d5fabe5908cd2e5cb8b50dee86e6d5 to your computer and use it in GitHub Desktop.
// join( seperator)
// seperator is optional, defaults to coma; use "" empty string to combine without spaces.
var someArray = ["a", "b", "c", 4, 5, ["bob", "bill"]];
var noSpace;
var hyphenated;
var commaSpace;
noSpace = someArray.join("");
console.log("noSpace:", noSpace);
// Pop Quiz -------------------------
//
// make a hyphenated string
//------code below this line ------------
//------code above this line ------------
console.log("hyphenated:", hyphenated);
// make a comma seperated string
//------code below this line ------------
//------code above this line ------------
console.log("commaSpace:", commaSpace);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment