How to round down in JavaScript?

To round down in JavaScript, call the Math.floor function.

Here's how you do it:

const number = 3.99;
const roundedDown = Math.floor(number);

console.log(roundedDown); // 3