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 test= "Hi I am a fullstack developper";
2var result= test.split("l");
3//return:
4// [Hi I am a fu,,stack deve,lopper]
5
6/*the split methode replace the (letter/symbole) into the
7brackets to "," and transform it to array.*/