Map¶
Converts all rows in the table to the return value of the given callback function.
1 | |
Parameters¶
(this: DataRow, row: DataRow, i: number) => any fn
A function to call for every row. Inside the function, this is the row; the arguments are the row and its index.
Returns¶
An array containing the results of the callback function for each row.
Remarks¶
When the callback returns undefined or null, the row itself is added to the result.
Examples¶
Convert rows to plain objects¶
1 2 3 4 5 6 7 8 9 10 11 12 | |
Collect the values of a column¶
1 2 3 | |