JSFiddle - React, Tailwind, and code Playground
HTML
<pre id="out"></pre>
JavaScript
const pivot = a=>a.reduce((c,e,i)=>(e.forEach((n,j)=>c[j][i]=n),c),a[0].map(z=>[]));
const arr1 = [['a', 'b'], ['1', '2'], ['+', '-']];
const arr2 = [['a', 'b', 'c'], ['1', '2', '3'], ['+', '-', '*']];
const a1 = pivot(arr1);
const a2 = pivot(arr2);
// print
out.textContent =
JSON.stringify(a1, null, 4) +
'\n-------------\n' +
JSON.stringify(a2, null, 4);