Get the latest tech news
AI Coding assistants provide little value because a programmer's job is to think
Writing code is easy; getting it right is hard.
The event handler will run in response to a click event which is an inversion of control that means execution doesn't flow from top to bottom In the handler, it's completely unclear that this is the window, which is also the global object that can be referenced implicitly, so we could end up defining values here that could be naïvely referenced from another scope. The handler implicitly ignores arguments Odds are good that this will be bundled, meaning that without additional effort for source mapping, stack traces on runtime errors will be incorrect.#thing references a DOM element that's out of context here. And quite frankly, for most of the real problems (as opposed to the stupid bugs - of which there are many, as the latest crap with "truncate()" has shown us) a debugger doesn't much help.
Or read this on Hacker News