source:
frontend/node_modules/underscore/modules/random.js
| Last change on this file was 9af201e, checked in by , 11 days ago | |
|---|---|
|
|
| File size: 222 bytes | |
| Line | |
|---|---|
| 1 | // Return a random integer between `min` and `max` (inclusive). |
| 2 | export default function random(min, max) { |
| 3 | if (max == null) { |
| 4 | max = min; |
| 5 | min = 0; |
| 6 | } |
| 7 | return min + Math.floor(Math.random() * (max - min + 1)); |
| 8 | } |
Note:
See TracBrowser
for help on using the repository browser.
