Message from JavaScript discussions

September 2018

— If you see that, you'll know getElementsByClassName has enough perf benefit to prefer it when:
1. You know you're only going to lookup based on class name
2. You're doing many such operations

Message permanent page


QuerySelector is good when:
1. You need the flexibility of CSS selectors
2. You're only doing a handful of tasks and performance wouldn't be a bottleneck

— Or you are not going to use css specificity🤤

— Ye. world will not crush

— What

— Who need to select nodes in the loop. its a single case operation

— Abstraction is more important here

— Heard of BEM? react plague

— They made a list from the tree. it works faster🤤

— Stupid idea

— Hey

— I need a Javascript programmer