javascript string to array

JavaScript
//split into array of strings.
var str = "Well, how, are , we , doing, today";
var res = str.split(",");const str = 'Hello!';

console.log(Array.from(str)); //  ["H", "e", "l", "l", "o", "!"]const str = 'Hello!';

const arr = Array.from(str);
//[ 'H', 'e', 'l', 'l', 'o', '!' ]// If you want to split on a specific character in a string:
const stringToSplit = '01-02-2020';
console.log(stringToSplit.split('-')); 
// ["01", "02", "2020"]

// If you want to split every character:
const stringToSplit = '01-02-2020';
console.log(Array.from(stringToSplit));
// ["0", "1", "-", "0", "2", "-", "2", "0", "2", "0"]// bad example https://stackoverflow.com/questions/6484670/how-do-i-split-a-string-into-an-array-of-characters/38901550#38901550

var arr = foo.split(''); 
console.log(arr); // ["s", "o", "m", "e", "s", "t", "r", "i", "n", "g"]// Split string into an array of strings
const path = "/usr/home/chucknorris"
let result = path.split("/")
console.log(result)
// result
// ["", "usr", "home", "chucknorris"]
let username = result[3]
console.log(username)
// username
// "chucknorris"
Source

Also in JavaScript: