I am trying to achieve something similar to the code snippet below. However, it seems to be invalid as it does not allow passing variables, specifically 'min' and 'max' in this case.
Is there a way to achieve this functionality? If so, how can it be done?
Thank you. J.
var utils = (function() {
function randomRange(min, max) {
return ((Math.random() * (max - min)) + min);
};
return {
randomRange : randomRange(min, max);
};
}());
utils.randomRangeRound(20,5);