Latest
function toSafeInteger
import { toSafeInteger } from "https://dotland.deno.dev/x/lodash_es@v0.0.2/mod.ts";

Converts value to a safe integer. A safe integer can be compared and represented correctly.

Examples

_.toSafeInteger(3.2); // => 3

_.toSafeInteger(Number.MIN_VALUE); // => 0

_.toSafeInteger(Infinity); // => 9007199254740991

_.toSafeInteger('3.2'); // => 3

Parameters

value

The value to convert.