Skip to content

Commit b6adcd2

Browse files
committed
use const
1 parent 9c648ef commit b6adcd2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

debugging/book-library/script.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ function render() {
6464
//insert updated row and cells
6565
let length = myLibrary.length;
6666
for (let i = 0; i < length; i++) {
67-
let row = tableBody.insertRow(); // why (1) not i+1 insert <tr> with four <td>
68-
let titleCell = row.insertCell(0); // the table.rows and row.cells are HTMLCollection,not a real array, but they behave like array(indexed,length) . they are DOM collections
69-
let authorCell = row.insertCell(1);
70-
let pagesCell = row.insertCell(2);
71-
let wasReadCell = row.insertCell(3);
72-
let deleteCell = row.insertCell(4); // it is like insert for <td> </td>
67+
const row = tableBody.insertRow(); // why (1) not i+1 insert <tr> with four <td>
68+
const titleCell = row.insertCell(0); // the table.rows and row.cells are HTMLCollection,not a real array, but they behave like array(indexed,length) . they are DOM collections
69+
const authorCell = row.insertCell(1);
70+
const pagesCell = row.insertCell(2);
71+
const wasReadCell = row.insertCell(3);
72+
const deleteCell = row.insertCell(4); // it is like insert for <td> </td>
7373
titleCell.textContent = myLibrary[i].title; //filling the cells why innerHTML
7474
authorCell.textContent = myLibrary[i].author;
7575
pagesCell.textContent = myLibrary[i].pages;

0 commit comments

Comments
 (0)