MCPcopy Create free account
hub / github.com/jashkenas/underscore / random

Function random

underscore.js:823–829  ·  view source on GitHub ↗
(min, max)

Source from the content-addressed store, hash-verified

821
822 // Return a random integer between `min` and `max` (inclusive).
823 function random(min, max) {
824 if (max == null) {
825 max = min;
826 min = 0;
827 }
828 return min + Math.floor(Math.random() * (max - min + 1));
829 }
830
831 // A (possibly faster) way to get the current timestamp as an integer.
832 var now = Date.now || function() {

Callers 1

sampleFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected