split array in js code example
Example 1: string to array javascript
const stringToSplit = '01-02-2020';
console.log(stringToSplit.split('-'));
const stringToSplit = '01-02-2020';
console.log(Array.from(stringToSplit));
Example 2: javascript split
var arr = foo.split('');
console.log(arr);
Example 3: split array javascript
arr.slice(start, end);
Example 4: split javascript
var str = "12,15,16,78,59";
var res = str.split(",");
console.log(res[0]);
console.log(res[2]);
Example 5: HOW TO SPLIT AN ARRAY JAVASCRIPT
array.splice(index, number, item1, ....., itemN)