|
|
|
|
|
by tgv
665 days ago
|
|
> I would argue the problem is how dependencies in general are added to projects But you need the functionality anyway, so there are two dependencies: on your own code, or on someone else's code. But you can't avoid a dependency, and it comes at a cost. If you don't know how to code the functionality, or it will take too much time, a library is an outcome. But if you need leftPad or isNumber as an external dependency, that's so far in the other direction, it's practically a sign of incompentence. |
|
Could you for laughs explain for which cases these are, why they are needed and why they did it this way?
1) num-num === 0
2) num.trim() !== ''
3) Number.isFinite(+num)
4) isFinite(+num)
5) return false;
6) Why this specific order of testing? Why prefer Number.isFinite over isFinite?
https://www.npmjs.com/package/is-number
I would have just.... Why is that not precisely the same? (it isn't)how about...
Is there a difference?IMHO NPM should have a discussion page for this. There are probably interesting answers for all of those looking to copy and paste.