Function trunc

Truncate the decimal part of each element in an array.

> trunc([1.2, 2.5, 3.7])
[1, 2, 3]
  • Parameters

    • array: number[]

      The array of numbers.

    Returns number[]

    An array with the integer part of each input element.