MCPcopy Index your code
hub / github.com/cazala/synaptic / noRepeat

Function noRepeat

test/synaptic.js:17–25  ·  view source on GitHub ↗
(range, avoid)

Source from the content-addressed store, hash-verified

15
16// utils
17function noRepeat(range, avoid) {
18 var number = Math.random() * range | 0;
19 for (var i in avoid) {
20 if (number == avoid[i]) {
21 return noRepeat(range, avoid);
22 }
23 }
24 return number;
25}
26
27function equal(prediction, output) {
28 for (var i in prediction)

Callers 3

synaptic.jsFile · 0.85
noRepeatMethod · 0.85
DSRMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected