When using querySelectorAll to collect elements that match a selector, they are stored in a NodeList. The forEach loop then cycles through the NodeList, where each individualItem is of type "Element".
The issue arises when passing these individualItems to the function "doThing()", which specifically requires them to be of type "HTMLElement" due to using TypeScript. This leads to the question of whether there exists a native JavaScript function for converting an "Element" type into an "HTMLElement" type, and if not, what such a function might entail.
const h = document.querySelectorAll(someClassString);
h.forEach(individualItem => {
individualItem.addEventListener(c.EVENT, () => doThing(individualItem));
})