3 ms·
And the corresponding source code [0] if (typeof num === 'number') { return num - num === 0; } if (typeof num === 'string' && num.trim() !== '') {
by thunderbong 6y ago
And the corresponding source code [0]
if (typeof num === 'number') {
return num - num === 0;
}
if (typeof num === 'string' && num.trim() !== '') {
return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
}
return false;
[0]: https://github.com/jonschlinkert/is-number/blob/master/index.js https://github.com/jonschlinkert/is-number/blob/master/index...