How to remove the digits after the decimal point in JavaScript

1 Answer

0 votes
console.log(Math.trunc(3.14)); 
console.log(Math.trunc(48.0)); 
console.log(Math.trunc(-8.936)); 

  
  
  
  
/*
run:
  
3
48
-8
  
*/

 



answered Jun 14, 2022 by avibootz
...