is this correct
var mid = math.floor((0 + array.length)/2)
from here you could use array.slice to divide the array into two equal sized arrays?
Printable View
is this correct
var mid = math.floor((0 + array.length)/2)
from here you could use array.slice to divide the array into two equal sized arrays?
Did you try?
You can divide the array in two equal sized arrays if the array contains an even number of elements. If it's uneven, one part will have one element more than the other part.
OK so now that I have the middle figured, how can I split the array into two arrays?
I'd say that the .splice() method would be the best way to do that.