search a word and separate in javascript

JavaScript
var myString = "An,array,in,a,string,separated,by,a,comma";
var myArray = myString.split(",");
/* 
*
*  myArray :
*  ['An', 'array', 'in', 'a', 'string', 'separated', 'by', 'a', 'comma']
*
*/var myString = "Hello World!";

// splitWords is an array
// [Hello,World!]
var splitWords = myString.split(" ");

// e.g. you can use it as an index or remove a specific word:
var hello = splitWords[splitWords.indexOf("Hello")];var data = "Welcome to Stack Overflow";
console.log(data.split(" ").splice(1));

Source

Also in JavaScript: