3 ms·
Strings are so tempting because they are there and everyone knows how to use them. But they are the wrong abstraction for building DOM nodes. They're error pro
by underwater 6y ago
Strings are so tempting because they are there and everyone knows how to use them.
But they are the wrong abstraction for building DOM nodes. They're error prone (no guarantees of correctness)
, encoding woes) and are write only (how do you modify a node that is encoded in a string). And what do expressions like html.substr(0, 7) even mean?
First class HTML composition in JS is pretty dang important.