February 2018
Intermediate to advanced
298 pages
8h 22m
English
The Math.trunc() function returns the integer part of a number by removing any fractional digit. Here is an example to demonstrate this:
console.log(Math.trunc(11.17));console.log(Math.trunc(-1.112));
The output is as follows:
11-1
Read now
Unlock full access