Table to JSON
const tabularData = [
['First Name', 'Last Name'],
['Adam', 'Buczek'],
['Jane', 'Doe'],
['John', 'Smith']
]
tableToJSON = (table) => {
const headerValues = tabularData.shift();
let data = [];
table.forEach(function(row) {
data.push(row.reduce(function(acc, cur, index) {
acc[headerValues[index]] = cur;
return acc;
}, {}));
})
return data;
}