#consol.log("Day-2");JavaScript Function ,Math.trunc()

#consol.log("Day-2");JavaScript Function ,Math.trunc()

Math.trunc()

Table of contents

No heading

No headings in the article.

The Math.trunc() a static JavaScript function accessed using a Math object is used to get the integer portion of a floating-point number. it eliminates all fractional digits and truncates the number to the right of it. it only takes a single parameter (number) and outputs the integer portion of the provider number. it is supported by all browsers.

console.log(Math.trunc(15.56));                    console.log(Math.trunc(15.56));

//output 15                                     
//output  -123