array string to array javascript code example
Example 1: convert string to array js
let string = 'ABCDEFG';
let newArray = string.split('');
console.log(newArray);
Example 2: string to array javascript
const str = 'Hello!';
console.log(Array.from(str));
Example 3: javascript string to array
const str = 'Hello!';
const arr = Array.from(str);
Example 4: convert a string to array in javascript
str = 'How are you doing today?';
console.log(str.split(" "));
Example 5: number to array js
const arrayOfDigits = numToSeparate.toString().split("");
Example 6: string to array javascript
const string = "Hello!";
console.log([...string]);