File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ function render() {
7676 changeBut . className = "btn btn-success" ;
7777 wasReadCell . appendChild ( changeBut ) ;
7878 let readStatus = "" ;
79- if ( myLibrary [ i ] . check == " false" ) {
79+ if ( myLibrary [ i ] . check == false ) {
8080 readStatus = "No" ;
8181 } else {
8282 readStatus = "Yes" ;
@@ -88,8 +88,7 @@ function render() {
8888 render ( ) ;
8989 } ) ;
9090
91-
92- // second option to booleans comparisons
91+ // // second option to booleans comparisons
9392 // let changeBut = document.createElement("button");
9493 // changeBut.id = i;
9594 // changeBut.className = "btn btn-success";
@@ -110,16 +109,15 @@ function render() {
110109 // render();
111110 // });
112111
113-
114112 //add delete button to every row and render again
115113 const delButton = document . createElement ( "button" ) ;
116114 delButton . id = i + 5 ;
117115 deleteCell . appendChild ( delButton ) ;
118116 delButton . className = "btn btn-warning" ;
119117 delButton . innerHTML = "Delete" ;
120- delButton . addEventListener ( "click" , function ( index ) {
118+ delButton . addEventListener ( "click" , function ( ) {
121119 alert ( `You've deleted title: ${ myLibrary [ i ] . title } ` ) ;
122- myLibrary . splice ( index , 1 ) ;
120+ myLibrary . splice ( i , 1 ) ;
123121 render ( ) ;
124122 } ) ;
125123 }
You can’t perform that action at this time.
0 commit comments