how to convert string to an array javascript code example
Example 1: string to array javascript
const str = 'Hello!';
console.log(Array.from(str)); // ["H", "e", "l", "l", "o", "!"]
Example 2: string to array javascript
const string = "Hello!";
console.log([...string]); // ["H", "e", "l", "l", "o", "!"]