string array to array javascript code example
Example 1: js array to string
var myArray = ['no','u'];
var myString = myArray.toString();
Example 2: string to array javascript
const stringToSplit = '01-02-2020';
console.log(stringToSplit.split('-'));
const stringToSplit = '01-02-2020';
console.log(Array.from(stringToSplit));
Example 3: js string to array
var myString = 'no,u';
var MyArray = myString.split(',');
Example 4: javascript string to array
const str = 'Hello!';
const arr = Array.from(str);
Example 5: javascript convert to array
console.log(Array.from('foo'));
console.log(Array.from([1, 2, 3], x => x + x));