string to array noedjs code example
Example 1: js string to array
str = 'How are you doing today?';
console.log(str.split(' '));
>> (5) ["How", "are", "you", "doing", "today?"]
Example 2: js string to array
var myString = 'no,u';
var MyArray = myString.split(',');
Example 3: string to array javascript
const stringToSplit = '01-02-2020';
console.log(stringToSplit.split('-'));
const stringToSplit = '01-02-2020';
console.log(Array.from(stringToSplit));
Example 4: javascript string to array
const str = 'Hello!';
const arr = Array.from(str);
Example 5: how to change string to array in javascript
a=anyElement.all
Array.from(a).forEach(function (element){
console.log(element)
})