Hacker News new | ask | show | jobs
by scottharveyco 2882 days ago
That's what I have, a very small helper library that contains 5 or 6 functions that I use frequently like .closest(), .hideAll(), .showAll() etc.

My application doesn't use much JS so this seems reasonable to me instead of including a framework for a few functions.

1 comments

For what it's worth, https://caniuse.com/#feat=element-closest is supported by everyone except IE (and Opera Mini, I guess).
That's exactly the point! "Oh, you can code [a polyfill] yourself, and it will work. Mostly. Sort of. jQuery bad, reinventing the wheel good! Never mind that you originally went there to implement some business logic, let's get tangled in the myriad almost-almost-working combinations."
> Oh, you can code [a polyfill] yourself, and it will work.

Use a polyfill that already exists. Take it out when browser support is there.