JSFiddle - React, Tailwind, and code Playground

by pierian_design

JavaScript

var arrs = [

  [
    [["title1"],[7,17],[17],[27]],
    [["title2"],[8,18],[18],[28]],
  ],

  [
    [["title1"],[270],[170],[70],[170]],
    [["title2"],[""],[171],[71],[171]],
    [["title3"],[""],[172],[72],[172]],
    [["title4"],[""],[173],[12],[173]]
  ],

  [
    [["title1"],[370],[470]],
    [["title2"],[371],[471]],
    [[372],[472]],
    [[12],[473]],
    [[373],[474]],
    [[374],[475]],

  ]

];

var res = arrs.reduce(function(acc, el) {
  el.forEach(function(n, i) {
    acc[i] = acc[i] || [];
    n.forEach(function(m, j) {
      [].push.apply(acc[i][j] = acc[i][j] || [], [].concat(m));
    });
  });
  return acc;
}, []);

console.log(res);