4 ms·
JS's small standard lib is the cause of some of these issues. When I look at one of the JS projects I have worked on there is a non trivial amount of 'is-*' pa
by tempest_ 5y ago
JS's small standard lib is the cause of some of these issues.
When I look at one of the JS projects I have worked on there is a non trivial amount of 'is-*' packages whose only job is to identify the type of the object.
- andix 5y agoExactly. Somebody would need to put together a standard lib, maybe even by repacking some already de-facto standard libraries. But only one library per category (one „is“ library, one date library, …). It’s a very opinionated task, but it could really help.
- shagie 5y agois-odd, is-even... The radical code reuse where people don't ever want to write a one liner that exists in some other package is at issue too.
- andix 5y agoThere is even is-is-odd, lol
- dolni 5y agoThe small stdlib is part of it. The fact that identifying an object's type is so difficult is another part of it. It's also more foundational to JavaScript.