|
|
|
|
|
by ninjin
237 days ago
|
|
Really? The variable name lengths? Not that the code is clearer as: const te = document.createElement('table');
document.body.appendChild(te);
[
['one', 'two', 'three'],
['four', 'five', 'six' ],
].forEach((r, i) => {
const re = te.insertRow(i);
r.forEach((c, j) => {
re.insertCell(j).innerText = c;
})
});
My personal stance on short variable names is that they are fine as long as their scope is very limited, which is the case here. Rather, the "crime" to me is an overuse of rather pointless variables as the majority of them were only used once.Disclaimer: I have not tested the code and I only write JavaScript once every few years and when I do I am unhappy about it. |
|