split from space in javascript code example
Example 1: js string to array
var myString = 'no,u';
var MyArray = myString.split(',');//splits the text up in chunks
Example 2: javascript explode space
var str = "my car is red";
var stringArray = str.split(/(\s+)/);
console.log(stringArray); // ["my", " ", "car", " ", "is", " ", "red"]