1//split into array of strings.
2var str = "Well, how, are , we , doing, today";
3var res = str.split(",");
1var str = 'foobar';
2var arr = str.split('');
3console.log(arr); // ["f", "o", "o", "b", "a", "r"]
1var myString = 'no,u';
2var MyArray = myString.split(',');//splits the text up in chunks
3
1// bad example https://stackoverflow.com/questions/6484670/how-do-i-split-a-string-into-an-array-of-characters/38901550#38901550
2
3var arr = foo.split('');
4console.log(arr); // ["s", "o", "m", "e", "s", "t", "r", "i", "n", "g"]
1var str = "my car is red";
2var stringArray = str.split(/(\s+)/);
3
4console.log(stringArray); // ["my", " ", "car", " ", "is", " ", "red"]
1var linkElement = document.getElementById("BackButton");
2var loc_array = document.location.href.split('/');
3var newT = document.createTextNode(unescape(capWords(loc_array[loc_array.length-2])));
4linkElement.appendChild(newT);
5