javascript read string as array code example
Example 1: javascript string to array
const str = 'Hello!';
const arr = Array.from(str);
Example 2: javascript turn string into array
var fruits = 'apple, orange, pear, banana, raspberry, peach';
var ar = fruits.split(', ');
console.log( ar );
Example 3: convert string to array javascript
let myArray = str.split(" ");
Example 4: how to change string to array in javascript
a=anyElement.all
Array.from(a).forEach(function (element){
console.log(element)
})