Skip to content

Instantly share code, notes, and snippets.

@glebcha
Created February 5, 2014 08:48
Show Gist options
  • Save glebcha/8819534 to your computer and use it in GitHub Desktop.
Save glebcha/8819534 to your computer and use it in GitHub Desktop.
Get array from string with words separated with comma
var text = "one, two";
var text1 = text.split(",");
Array.prototype.slice.call(text1).map(function(item) {
return item.replace(" ", "");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment