But once its baseline I'll absolutely use it, anything to ship less javascript.
241 karma · joined June 3, 2024
But once its baseline I'll absolutely use it, anything to ship less javascript.
``` const $ = (param) => { if (typeof param === "string" || param instanceof String) { const elm = document.querySelectorAll(param); return elm.length > 1 ? elm : document.querySelector(param); } else { return [param].length === 1 ? [param][0] : [param]; } }; ```
The asteroid in spring hypothesis suggests that the asteroid impact that led to the K-Pg extinction event, occurred during spring season in the Northern Hemisphere.
Grumpy devs create simplified solutions.
Simple solutions make devs happy.
Happy devs create complex solutions.
Warms my old heart seeing kids playing the same plastic garbage I used to when I was their age.
document.querySelectorAll('.element').forEach(i => { yourFunction(i); });
I've not used map a whole lot, but I'm positive that it would work as well.
They are so damn verbose.
Producing code that isn't locked to a single framework or library is its own reward.
I see it more as a way of focussing on what we can do to elevate everyone, instead of just ourselves. But thats just my personal interpretation.