Re:NPM – "is-even", 160k weekly downloads
by mannerheim on Tuesday November 16, 2021 @12:00PM
(#29242974)
If so, the implementation of isEven isn't even right because it assumes anything that isn't an odd number is an even number.
Re:NPM – "is-even", 160k weekly downloads
by Ajedi32 on Tuesday November 16, 2021 @12:01PM
(#29243015)
No, the code posted in this thread clearly indicates it will raise an exception in such cases.
Re:NPM – "is-even", 160k weekly downloads
by mannerheim on Tuesday November 16, 2021 @12:04PM
(#29243053)
Ah, that's right, never mind.
I think the assertion (sorry for the pun) is that JavaScript is a completely unholy creation and should be chucked off the edge of the disc.
I can’t imagine trying to get some of our fintech business logic in there without arming a nuclear foot gun or ten. I would never sleep again without medication.
Or are are all those extra checks unnecessary now that TypeScript exists and new functions like Number.isInteger have widespread browser support?