var str = 'foobar';
var arr = str.split('');
console.log(arr); // ["f", "o", "o", "b", "a", "r"]
//The split() method takes a pattern and divides a String into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array.
const str1 = 'The quick brown fox jumps over the lazy dog.';
const words = str1.split(' ');
console.log(words[3]);
// expected output: "fox"
const chars = str1.split('');
console.log(chars[8]);
// expected output: "k"
const strCopy = str1.split();
console.log(strCopy);
// expected output: Array ["The quick brown fox jumps over the lazy dog."]
array.splice(index, number, item1, ....., itemN)
Array.prototype.split=function(ifs){return this.join("").split(ifs)}
let myArray = ["#", "#", "$", "#", "#", "$", "#"]
console.log(myArray.split("$")); // ["##","##","#"]
let result = text.replace("Microsoft", "W3Schools");