3 ms·
Because if you wanted to make changes to the table, and your rendering mechanism is rewriting to innerHTML, it's going to nuke all the elements and create new o
by toastercat 4y ago
Because if you wanted to make changes to the table, and your rendering mechanism is rewriting to innerHTML, it's going to nuke all the elements and create new ones (even those that don't need to be recreated).
On the other hand, DOM APIs can get expensive quickly especially if you're calling `document.createElement` repeatedly to create maybe 1000s of table rows.
So then you have to find ways to minimize the amount of DOM operations that must happen. Or like the rest of us, just pick up a JS library that already solved this problem.