diff --git a/csv/_io.ts b/csv/_io.ts index e9785a2d4f86..e8340d0a0944 100644 --- a/csv/_io.ts +++ b/csv/_io.ts @@ -262,8 +262,8 @@ export function convertRowToObject( ); } const out: Record = {}; - for (let i = 0; i < row.length; i++) { - out[headers[i]] = row[i]; + for (const [index, header] of headers.entries()) { + out[header] = row[index]; } return out; }