I see now that this is a NodeList object. The way it's currently being traversed seems OK according tohttps://developer.mozilla.org/en-US/docs/Web/API/NodeList#Why_can%27t_I_use_forEach_or_map_on_a_NodeList.3F.