The Math.round() method rounds a number to its nearest integer.

Math.round()

2.4 is rounded to 2:

2.6 is rounded to 3: