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