function* makeChunk(array, size = 1) {
let index = 0;
let taken;
let chunk;
do {
chunk = array.slice(index, index + size);
taken = chunk.length;
index += size;
yield chunk;
} while (taken === size);
}
const arr = [1, 2, 3, 4, 5, 6, 7, 8];
const chunked = makeChunk(arr, 2);
for (value of chunked) {
console.log(value);
}
// === or ===
// while ({ done, value } = chunked.next(), !done) {
// console.log(value);
// }
var date = new Date(Date.now() - performance.now() + e.timeStamp);