JavaScript(JS) math method - trunc

https‮gi.www//:‬iftidea.com

The trunc method in JavaScript's Math object returns the integer part of a number, i.e., the part of the number before the decimal point. The trunc method takes one argument, which is the number to truncate.

Here's an example usage:

const num = 3.14159265359;
const truncatedNum = Math.trunc(num);
console.log(truncatedNum); // 3

In the above example, the Math.trunc method is used to truncate the number 3.14159265359. The result, which is 3, is then logged to the console.