1b9763b72fe06191fb4e058d3f6a843e6d1ba759b1b5e70c78754a2db5b64fd03fe378f606c61025d5c8c4d07f5176faf7d1dc3d336b89065574d50f6215f0 541 B

123456789101112131415161718
  1. /* Built-in method references for those with the same name as other `lodash` methods. */
  2. var nativeFloor = Math.floor,
  3. nativeRandom = Math.random;
  4. /**
  5. * The base implementation of `_.random` without support for returning
  6. * floating-point numbers.
  7. *
  8. * @private
  9. * @param {number} lower The lower bound.
  10. * @param {number} upper The upper bound.
  11. * @returns {number} Returns the random number.
  12. */
  13. function baseRandom(lower, upper) {
  14. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  15. }
  16. module.exports = baseRandom;