1var myString = "An,array,in,a,string,separated,by,a,comma";
2var myArray = myString.split(",");
3/*
4*
5* myArray :
6* ['An', 'array', 'in', 'a', 'string', 'separated', 'by', 'a', 'comma']
7*
8*/
1var myString = "Hello World!";
2
3// splitWords is an array
4// [Hello,World!]
5var splitWords = myString.split(" ");
6
7// e.g. you can use it as an index or remove a specific word:
8var hello = splitWords[splitWords.indexOf("Hello")];
1var data = "Welcome to Stack Overflow";
2console.log(data.split(" ").splice(1));
3