Options
All
  • Public
  • Public/Protected
  • All
Menu

Module toInteger

Index

References

Functions Lang

References

Renames and re-exports toInteger

Lang Functions

  • toInteger(value: any): number
  • Converts value to an integer.

    Note: This method is loosely based on ToInteger.

    since

    5.5.0

    see

    [[isInteger]], isNumber, toNumber

    example
    toInteger(3.2)
    // => 3

    toInteger(Number.MIN_VALUE)
    // => 0

    toInteger(Infinity)
    // => 1.7976931348623157e+308

    toInteger('3.2')
    // => 3

    Parameters

    • value: any

      The value to convert.

    Returns number

    Returns the converted integer.