DEV Community

Discussion on: 6 Advanced JavaScript Concepts You Should Know

Collapse
 
james0r profile image
James Auble • Edited

With regard to as you call it "contextual targeting":

1) Seems like the word "contextual" is typically used in situations where something is reactive to its context which wouldn't be the case here. Just about semantics, it seems this is worth noting.

2) Using the element selector methods on the parent node seems perfectly fine here, but is there some advantage you're seeing over just using querySelectorAll on the document and leveraging the CSS cascade with selectors? Such as document.querySelectorAll('#footer a') and then iterating through the nodelist with forEach?

codepen.io/James0r/pen/KKmObNx

At any rate I liked the article! You sent me down a rabbit hole with closures and I really enjoyed my morning reads!