I use the following code to get random value from specifed range
var provideRanges = function(){
var aa = [];
_.times(3, function(i) {
console.log(i);
let num = _.random(10, 20)
console.log("num = :" + num)
debugger;
aa.push(num);
console.log("value is :" + aa[i]);
});
}
This is working and provide array of 3 values between the specified range when you call to this function, but the problem here become more difficult when I need that if I call it again ignore exclude the previous provided number from the provided numbers (like if it provide 10,11,12 the next time those numbers should not be provided...), is there is nicer way to do it? I try to use recoursive call but get lost:( ,any idea how to do it?