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