Skip to main content Accessibility Feedback

Numbers

Math.floor()

Returns the largest integer (whole number) less than or equal to a number.

// returns 42
Math.floor(42);

// returns 3
Math.floor(3.14);

// Returns -4
Math.floor(-3.14);

Preorder my new course on Web Components! Want to learn how to build Web Components from scratch, master best practices, and more? Preorder today and get $100 off of the launch price.


Find this useful? You can support my work by purchasing an annual membership.