I immediately knew something was awry when I saw the derpy new "const" nonsense being used for nothing, whilst simultaneously using the dated browser-proprietary not even part of the specifications "innerText".

And sure enough, you managed to turn 952 bytes of poorly written code into 1.6k of convoluted cryptic nonsense. Everything I've come to expect from the folks who are embracing the trash that are promises, let/const, arrow functions and this ridiculous unfounded obsession with the mind-numbingly stupid idea that "syde affakts rrr teh evuls!"

This is supposed to be "easier" or "simpler" or "clearer" than a simple XMLHTTPRequest with a normal result handler HOW exactly?!?

But to be fair, I'm the type of developer who sees a "getElementById" of a scripting only error box, I assume the markup being operated upon is also equally trash... since as a scripting only client-side element, it has no business in the markup and you should already have a variable for it.

Unless of course one uses the "we can't have any side effects" idiocy to avoid a perfectly good and rational script construction method because of a pedantic nonsensical LIE.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store