How to remove the digits after the decimal point in Node.js

1 Answer

0 votes
console.log(Math.trunc(3.14)); 
console.log(Math.trunc(126.0)); 
console.log(Math.trunc(-4.65234)); 

  
  
  
  
/*
run:
  
3
126
-4
  
*/

 



answered Jun 14, 2022 by avibootz
...