split in javascript returns code example
Example 1: string split 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']
*
*/
Example 2: split javascript
var test= "Hi I am a fullstack developper";
var result= test.split("l");
//return:
// [Hi I am a fu,,stack deve,lopper]
/*the split methode replace the (letter/symbole) into the
brackets to "," and transform it to array.*/