nimash3eshan / COMBook

Require template literals instead of string concatenation JS-0246
Anti-pattern
Minor
2 years ago2 years old
Unexpected string concatenation.
187    row.insertCell().appendChild(document.createTextNode(status.toString()))
188    row.insertCell().appendChild(document.createTextNode(description.toString()))
189    row.insertCell().appendChild(document.createTextNode(amount.toString()))
190    row.insertCell().innerHTML = '<td ><button id="'+ id.toString() +'"onclick="deleteRecord(this.id)" type="button">Delete</button></td>';191
192}
193//ela
Unexpected string concatenation.
70function addTotalRow(){
71    let table = getElementById("tbTable");
72    let row = table.insertRow();
73    row.innerHTML = '<tr class="lastrow"> <td></td> <td class="bold align_right">'+parseFloat(totDebit).toFixed(2)+'</td> <td class="bold align_right">'+parseFloat(totCredit).toFixed(2)+'</td> </tr>'74}
Unexpected string concatenation.
50        console.log(variable);
51
52
53        document.getElementById("tbody").innerHTML += '<td>' + record.ID + '</td>' +54            '<td>' + record.Date.slice(0,10) + '</td>' +55            '<td>' + record.description + '</td>' +56            '<td><span class="status '+ record.Type +'x">' + record.Type + '</span></td>' +57            '<td>' + variable + '</td>' +58            '<td>' + record.Amount + '</td>';59    });
60}
61
Unexpected string concatenation.
66            console.log(r)
67
68            document.getElementById('netprofit').innerHTML = 'Rs.'+r.data().Net_Profit;
69            document.getElementById('grossprofit').innerHTML = 'Rs.'+r.data().Gross_Profit;70            document.getElementById('totassets').innerHTML = 'Rs.'+r.data().Total_Assets;
71            document.getElementById('titliabs').innerHTML = 'Rs.'+r.data().Total_Liabilities;
72            document.getElementById('totequi').innerHTML = 'Rs.'+r.data().Total_Equity;
Unexpected string concatenation.
67
68            document.getElementById('netprofit').innerHTML = 'Rs.'+r.data().Net_Profit;
69            document.getElementById('grossprofit').innerHTML = 'Rs.'+r.data().Gross_Profit;
70            document.getElementById('totassets').innerHTML = 'Rs.'+r.data().Total_Assets;71            document.getElementById('titliabs').innerHTML = 'Rs.'+r.data().Total_Liabilities;
72            document.getElementById('totequi').innerHTML = 'Rs.'+r.data().Total_Equity;
73        }