xxxxxxxxxx
var str = 'foobar';
var arr = str.split('');
console.log(arr); // ["f", "o", "o", "b", "a", "r"]
xxxxxxxxxx
Array.prototype.split=function(ifs){return this.join("").split(ifs)}
let myArray = ["#", "#", "$", "#", "#", "$", "#"]
console.log(myArray.split("$")); // ["##","##","#"]
xxxxxxxxxx
var linkElement = document.getElementById("BackButton");
var loc_array = document.location.href.split('/');
var newT = document.createTextNode(unescape(capWords(loc_array[loc_array.length-2])));
linkElement.appendChild(newT);