Why Does 'is-number' Package Have 59M Weekly Downloads?
shubhamjain.co
shubhamjain.co
I don't know how to check if a Javascript object is a number. I've seen various "javascript == and === and types really weird" videos, so I think I'd be tempted to just use an 'is-number' package, to be really sure I'm getting it right.
So maybe the issue is that it's really hard to do basic things right in Javascript?
The answer to this in most other languages would be to design a "standard library", then everyone would import that package, and while they would have just as much code, it would come in less pieces.
Looking at it, the check might not be trivial in untyped JavaScript. Not sure which edge case this covers, so maybe you actually do need to know all the ins-and-outs of JavaScript to be sure that what you are dealing with is indeed a number.