Files
30-seconds-of-code/test/randomIntArrayInRange/randomIntArrayInRange.js
2018-01-15 14:25:18 +03:00

2 lines
145 B
JavaScript

module.exports = randomIntArrayInRange = (min, max, n = 1) =>
Array.from({ length: n }, () => Math.floor(Math.random() * (max - min + 1)) + min);