_.isSafeInteger

_.isSafeInteger(value)

Checks if value is a safe integer. An integer is safe if it's an IEEE-754 double precision number which isn't the result of a rounded unsafe integer.

Note: This method is based on Number.isSafeInteger.

Since

4.0.0

Arguments

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

Returns

(boolean): Returns true if value is a safe integer, else false.

Example

_.isSafeInteger(3);
// => true
 
_.isSafeInteger(Number.MIN_VALUE);
// => false
 
_.isSafeInteger(Infinity);
// => false
 
_.isSafeInteger('3');
// => false
doc_Lodash
2016-11-27 16:38:27
Comments
Leave a Comment

Please login to continue.