Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

define math.trunc() method in javascript

// Math.trunc()

// The Math. trunc() function returns the integer part of a number by removing any fractional digits.

// EXAMPLE : 1
let num = Math.trunc(99.75);
console.log(num);
// OUTPUT: 99

// EXAMPLE : 2
let num_1 = Math.trunc(-57.43);
console.log(num_1);
// OUTPUT: 57
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #define #method #javascript
ADD COMMENT
Topic
Name
6+3 =