Math.trunc() - JavaScript | MDN

The Math.trunc() static method returns the integer part of a number by removing any fractional digits.