I'm trying to chunk my array into 3 using this code
var a = ["a", "b", "c", "d", "e", "f", "g"];
let chunk;
while (a.length > 0) {
chunk = a.splice(0, 3);
console.log(chunk);
}
but how can I get a result something like these
var array1 = ["a", "d", "g"];
var array2 = ["b", "e"];
var array3 = ["c", "f"];