If I have an array like this var arr = [1,3,2,4,8,9,8,6,9]
How can I equally split the array to multiple arrays in a object like this
{ '0': { num: [ 1,3,2 ] },
'1': { num: [ 4,8,9 ] },
'2': { num: [ 8,6,9 ] }
}
Thanks
Edit: The numbers of multiple arrays can change. Example I want to divide into three thirds of existing array or four quarters in som cases.