_.toNumber

_.toNumber(value)

Converts value to a number.

Since

4.0.0

Arguments

  1. value (*): The value to process.

Returns

(number): Returns the number.

Example

1
2
3
4
5
6
7
8
9
10
11
_.toNumber(3.2);
// => 3.2
  
_.toNumber(Number.MIN_VALUE);
// => 5e-324
  
_.toNumber(Infinity);
// => Infinity
  
_.toNumber('3.2');
// => 3.2
doc_Lodash
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.