mod.js 142 B

1234
  1. module.exports = function mod(number, modulo) {
  2. var remain = number % modulo;
  3. return Math.floor(remain >= 0 ? remain : remain + modulo);
  4. };