1. Home
  2. ›
  3. Javascript
  4. ›
  5. Math round

Math.round() method takes a single number as an argument and returns the closest integer.

#javascript#math
Math.round(0.9); // Returns 1
Math.round(1.49876); // Returns 1
Math.round(1.5); // Returns 2
copy
Full Javascript cheatsheet