WeCodeAcademy
❮ Math.ceil()Math.abs() ❯

Math.trunc()

Removes the decimal part.

Group: Math

Syntax

Math.trunc(x)

Example

Examplejavascript
Open in editor »

← All of JavaScript Reference