1. Home
  2. Javascript
  3. Math round
#javascript#math

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
Full Javascript cheatsheet
Sitemap Git repository