Function round

Round each element in an array to the nearest integer.

> round([1.2, 2.5, 3.7])
[1, 3, 4]
  • Parameters

    • array: number[]

      The array of numbers.

    Returns number[]

    An array with each input element rounded to the nearest integer.