1//split into array of strings.
2var str = "Well, how, are , we , doing, today";
3var res = str.split(",");
1// Example array.
2let randomArray = [3, 5, 1, 5, 7,];
3// Create an empty array.
4let arrayOfArrays = [];
5
6function splitArray( array ) {
7 while (array.length > 0) {
8 let arrayElement = array.splice(0,1);
9 arrayOfArrays.push(arrayElement);
10 }
11 return arrayOfArrays;
12}
13
14// Call the function while passing in an array of your choice.
15splitArray(randomArray)
16// => [ [ 3 ], [ 5 ], [ 1 ], [ 5 ], [ 7 ] ]
1var linkElement = document.getElementById("BackButton");
2var loc_array = document.location.href.split('/');
3var newT = document.createTextNode(unescape(capWords(loc_array[loc_array.length-2])));
4linkElement.appendChild(newT);
5
1import numpy as np # import some stuffs
2
3arr = np.array([1, 2, 3, 4, 5, 6]) #create array
4
5
6newarr = np.array_split(arr,3); # split the array up to 3
7print(newarr)
8
9