I have a data of 82 items and i want to write 10 each in a file.How can i separate the array such that i get 10 each and 2 in another file.
MY code,
var data = [];
data.forEach(function(i,v) {
if((v != 0) && (v%10 === 0)) {
var appendData = blogList.splice(0,10);
fs.writeFile(appendData){
}
}
I have a data of 82 items and i want to write 10 each in a file.How can i separate the array such that i get 10 each and 2 in another file.
But I am getting the first 10 items in files.Can anyone help me.Thanks.