This reminds me of that video where LGR reviewed a keyboard with a PIZZA keyboard key. Probably more useful of a usecase than this really... (https://youtu.be/USQxZc9nmtE)
Using JS over CSS for sizing elements rarely is a 'better solution', mostly because of flashes of unstyled content - especially on mobile where it might take longer for the JS to fully initialise.
Like other comments on here say, just use height: 100% instead.
Every time a article like this is posted I'm just flabbergasted at the fact that 'looking behind you before actually opening a door' is such a foreign concept to Americans.
Yes, so let's all keep reinventing the wheel, over and over again.
I know the author uses pretty extreme examples, but I still don't see what's inherently wrong with the mentioned packages.
- it does what you think it does:
`isOdd(2)` is a lot easier to understand than `value % 2`
- even though most of these are one liners, it's one line of code less that you have to maintain
- if the package is at least somewhat popular, it's highly likely it has measures for edge cases; stuff I wouldn't have thought of when writing it myself.
On top of that, mentioning left-pad is really cliche and weak at this point (bear in mind this happend 2 years ago), npm has taken measures and nothing similar has happend since then, and even then, it was still a fairly isolated event - the whole thing actually took 10 minutes.
I'd much rather take a rare, yet-to-happen-again chance that a package goes down, over having to rewrite simple utility functions over and over again, every month.