Hacker News new | ask | show | jobs
by moritzwarhier 970 days ago
This won't throw an error if the form ID changes. Which is to be expected for working on collections. But I don't like this being the default, exactly because of cases like this.

Same thing of course applies to people who throw around the optional chaining operator without thinking to please TS.

Or would apply if one used a single selector here and document.querySelectorAll

The needless chaining here is a typical example of misleading jQuery code though. Looks as if it was there to prevent this issue.