The type of the values in the objects.
The array of objects to convert to a table.
The options for converting the objects to a table.
Optional
emptyAn optional value to use for empty cells. If not provided, the function will use undefined
.
Optional
headers?: string[]An optional array of strings specifying the headers (property names) to use. If not provided, the function will use all unique keys found in the objects.
A 2D array (table) where each row represents an object and each column represents a property of the object.
arrObjectsToTable(
[
{ a: 1, b: 2 },
{ a: 3, b: 4, c: 5 },
],
{ emptyCell:1 },
) //=> [ [ 'a', 'b', 'c' ], [ 1, 2,1 ], [ 3, 4, 5 ] ]
Generated using TypeDoc
Convert an array of objects to a two-dimensional table.