js divide string by char code example

Example 1: split string by length python

>>> x = "qwertyui"
>>> chunks, chunk_size = len(x), len(x)/4
>>> [ x[i:i+chunk_size] for i in range(0, chunks, chunk_size) ]
['qw', 'er', 'ty', 'ui']

Example 2: javascript explode

//split into array of strings.
var str = "Well, how, are , we , doing, today";
var res = str.split(",");

Example 3: javascript convert in a string the items of an array

const arr = [1, 2, 'a', '1a'];
const str = arr.toString();
console.log(str); //> "1,2,a,1a"

Example 4: js string to array

var myString = 'no,u';
var MyArray = myString.split(',');//splits the text up in chunks