const your_array = ['a','b','c','d','e','f']
const thread1Length = Math.floor(your_array.length/2)
const thread2Length = your_array.length-thread1Length
const thread1 = your_array.slice(0,thread1Length)
const thread2 = your_array.slice(thread1Length,your_array.length)
function cleanUpArray(arr) {
let intArray = arr.map(x => parseInt(x))
let evenArray = []
intArray.map(x => {
if(x % 2 === 0){
evenArray.push(x)
}
})
let oddArray = []
intArray.map(x => {
if(x % 2 !== 0){
oddArray.push(x)
}
})
return [evenArray, oddArray]
}
chunk([1, 2, 3, 4, 5, 6, 7, 8], 4); // [[1, 2, 3, 4], [5, 6, 7, 8]]