r/javascript • u/[deleted] • Jul 11 '17
help What 10 Things Should a Serious Javascript Developer Know Right Now?
I'm inviting pure opinion here, but what's your list of ten things that everyone looking for a good javascript role should know and understand. Personally, I'm in a role where what I know is adequate, but I want to be somewhere better; somewhere that has some flippin standards. I'm learning outside of work requirements at the moment, but there is so much shit to learn out there.
The objective is to do good work in a good place.
Narrow it down to your ten for me, or for you.
Can be your own "I must learn x" list too. I'm very interested to hear what people think.
348
Upvotes
42
u/junior-dev Jul 11 '17
Can you source your x2800 claim against
document.querySelector?I can't tell if you're exaggerating or not. 2800 seems too specific to be an exaggeration, so I don't think you are.
I concede that
document.getElementById``document.getElementsByTagNameanddocument.getElementsByClassNameare faster thandocument.querySelectoranddocument.querySelectorAllrespectively -- by an order of magnitude of 10, and maybe even 100. But not 1000.I haven't found any evidence for a speed factor of ~2800.
Generally, people are curious about performance, so I've found several JSPerf tests for this.
https://jsperf.com/getelementbyid-vs-queryselector/11
https://jsperf.com/queryselectorall-vs-getelementsbytagname
https://jsperf.com/getelementsbyclassname-vs-queryselectorall/18
In the 2nd one, the difference is quite stark: ~x300 speed increase for
document.getElementsByTagName.But it's not ~2800, none of them are. I understand that these are isolated cases, a bit contrived and unrealistic. But can you come up with any test case that would demonstrate x2800?
I just don't believe it.