Math.floor()
Math.floor() is a JavaScript method in the Math category. Rounds down to the nearest integer. The syntax is Math.floor(x). A typical example: Math.floor(1.9) // 1. Another practical use — Truncate decimal: const price = 19.99 const dollars = Math.floor(price) console.log(dollars) // 19 The TypeScript signature is (x: number): number. A close sibling is Math.abs(), which returns the absolute value of a number. A close sibling is Math.ceil(), which rounds up to the nearest integer. A close sibling is Math.round(), which rounds to the nearest integer. A close sibling is Math.trunc(), which truncates the decimal part, returning the integer. More about this category: Math functions for calculations — random, round, sqrt, floor, and more. Related Math methods: Math.abs(), Math.ceil(), Math.round(), Math.trunc(), Math.max(), Math.min(), Math.random(), Math.sqrt(). This page is part of the free JS Reference documentation covering 1027+ methods, each with syntax, parameters, return values, examples, and common pitfalls.