Add fast path for numbers in _.toNumber.

This commit is contained in:
John-David Dalton
2016-03-05 16:56:59 -08:00
parent 0a9af2968e
commit 8ac1d54858
2 changed files with 17 additions and 0 deletions

View File

@@ -11022,6 +11022,9 @@
* // => 3
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}