math round
Math.round() method takes a single number as an argument and returns the closest integer.
Math.round(0.9); // Returns 1
Math.round(1.49876); // Returns 1
Math.round(1.5); // Returns 2
copy