Truncates the decimal part of a number (towards zero).
The number to truncate.
The integer part of the number, discarding any fractional digits.
truncate(3.9); // returns 3truncate(-2.8); // returns -2 Copy
truncate(3.9); // returns 3truncate(-2.8); // returns -2
Truncates the decimal part of a number (towards zero).