Skip to content

Instantly share code, notes, and snippets.

@gabsprates
Last active October 19, 2016 00:21
Show Gist options
  • Save gabsprates/90c243fa2b6afabb5dd48caadd31bade to your computer and use it in GitHub Desktop.
Save gabsprates/90c243fa2b6afabb5dd48caadd31bade to your computer and use it in GitHub Desktop.
// The `join()` of an empty Array
// always will be an empty string
var foo = new Array() // []
foo.join() // “”
foo.toString() // “”
// If the Array have elements,
// we have an cool string.
var bar = [ 1, 2, 3, 4, 5 ]
bar.join() // “1,2,3,4,5”
bar.toString() // “1,2,3,4,5”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment