JSFiddle - React, Tailwind, and code Playground
by clauswilke
JavaScript
const addgroup = (g1, g2) => g1.map((num, idx) => num + g2[idx])
const addconsts = (c1, c2) => c1.map((g1, idx) => addgroup(g1, c2[idx]))
let x = addconsts([[1, 2], [3, 4]], [[4, 4], [2, 2]])
console.log(x)