stackOverflow answer

node v0.12.18
version: master
endpointsharetweet
var data = ['123', '456', '789', '000', '111', '222', '333', '444', '555'] , length = 3 // this function is called recursively until the whole initial array is processed (and emptied) function splitTable() { var batch= data.splice(0, length) // process your batchhere (map to the function you want) console.log('batch' + batch) if (data.length) splitTable() } // initial call of the function splitTable()
Loading…

no comments

    sign in to comment