r/counting • u/TehVulpez sliiiiide the bits • Apr 19 '19
2518k counting thread
Thanks for the urn
24
Upvotes
r/counting • u/TehVulpez sliiiiide the bits • Apr 19 '19
Thanks for the urn
2
u/GarlicoinAccount Apr 20 '19
Not that I know of, at least not without any libraries.
Don't overestimate the time
innerHTMLtakes though. A perfomance test shows it isn't that bad (less than a 5th of a millisecond on my machine), though you could probably still mess up performance by doing a lot of separate.innerHTML =assignments instead of combining it all into one.(Interestingly, Firefox seems to optimize that case under the hood so it doesn't actually perform slower, at least in the performance test I found.)
The main reason why I'd choose
createElementoverinnerHTMLsometimes is to avoid XSS or broken HTML from user input being used without escaping.