Skip to content

Commit 0654054

Browse files
Jing19targos
authored andcommitted
lib: replace var to let in cli_table.js
PR-URL: #30400 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 2f32456 commit 0654054

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/internal/cli_table.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const tableChars = {
3030

3131
const renderRow = (row, columnWidths) => {
3232
let out = tableChars.left;
33-
for (var i = 0; i < row.length; i++) {
33+
for (let i = 0; i < row.length; i++) {
3434
const cell = row[i];
3535
const len = getStringWidth(cell);
3636
const needed = (columnWidths[i] - len) / 2;
@@ -49,9 +49,9 @@ const table = (head, columns) => {
4949
const columnWidths = head.map((h) => getStringWidth(h));
5050
const longestColumn = columns.reduce((n, a) => Math.max(n, a.length), 0);
5151

52-
for (var i = 0; i < head.length; i++) {
52+
for (let i = 0; i < head.length; i++) {
5353
const column = columns[i];
54-
for (var j = 0; j < longestColumn; j++) {
54+
for (let j = 0; j < longestColumn; j++) {
5555
if (rows[j] === undefined)
5656
rows[j] = [];
5757
const value = rows[j][i] =

0 commit comments

Comments
 (0)