From 502173b54e97e6a9e9912563c3dfcd8f114ebc37 Mon Sep 17 00:00:00 2001 From: Jing Lin Date: Tue, 12 Nov 2019 15:21:01 +0000 Subject: [PATCH] lib: replace var to let in cli_table.js PR-URL: https://github.com/nodejs/node/pull/30400 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: David Carlier Reviewed-By: Gireesh Punathil Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat --- lib/internal/cli_table.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/cli_table.js b/lib/internal/cli_table.js index aaa094e6a5d25f..ca8b206fd76394 100644 --- a/lib/internal/cli_table.js +++ b/lib/internal/cli_table.js @@ -30,7 +30,7 @@ const tableChars = { const renderRow = (row, columnWidths) => { let out = tableChars.left; - for (var i = 0; i < row.length; i++) { + for (let i = 0; i < row.length; i++) { const cell = row[i]; const len = getStringWidth(cell); const needed = (columnWidths[i] - len) / 2; @@ -49,9 +49,9 @@ const table = (head, columns) => { const columnWidths = head.map((h) => getStringWidth(h)); const longestColumn = columns.reduce((n, a) => Math.max(n, a.length), 0); - for (var i = 0; i < head.length; i++) { + for (let i = 0; i < head.length; i++) { const column = columns[i]; - for (var j = 0; j < longestColumn; j++) { + for (let j = 0; j < longestColumn; j++) { if (rows[j] === undefined) rows[j] = []; const value = rows[j][i] =