JavaScript Math.trunc()
JavaScript Math.trunc()
The Math.trunc() method is used to return the integer part of a number. It will not round up or down the number. It will just simply remove the decimals.
Syntax:-
Its syntax is:- Math.trunc(x)
Return:-
Its return is:- number
Further Explanation:-
Parameter | Description |
---|---|
x | Required. The number. |