How to perform an integer division and get the remainder in TypeScript

1 Answer

0 votes
const x = 26, y = 3;
 
const quotient = Math.floor(x / y);
const remainder = x % y;
 
console.log(quotient);
console.log(remainder);
   
   
   
   
   
/*
run:
   
8
2
   
*/

 



answered May 6, 2022 by avibootz
...