how to split string into a char array js code example Example: convert string to array javascript let myArray = str.split(" ");