How to perform an integer division and get the remainder in Node.js

1 Answer

0 votes
const x = 29, y = 3;

const quotient = Math.floor(x / y);
const remainder = x % y;

console.log(quotient);
console.log(remainder);
  
  
  
  
  
/*
run:
  
9
2
  
*/

 



answered May 6, 2022 by avibootz
...