Created
April 2, 2016 14:07
-
-
Save goodbedford/c2d5fabe5908cd2e5cb8b50dee86e6d5 to your computer and use it in GitHub Desktop.
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
| // 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