Learn JavaScript
Math Object
18.13
Lesson

Removing Fractional Part of Number

The Math.trunc() method removes the fractional part from a number, which is everything after the decimal point. It returns only the integer part of the number.