Math.round()
Try it yourself →Rounds to the nearest integer.
Syntax
Math.round(number)
Description
0.5 and above rounds up, below rounds down.
Returns
Rounded integer.
Example
console.log(Math.round(4.6)); console.log(Math.round(4.4));
Expected output
5 4
When to use?
Simplifying scores, averages, price displays.