Hi

I am trying to write a function that will generate a random number b/w 1-10 but what I also want is that the function should return the random number only once (no matter how many times we call it) unless we force it to generate it using a flag or something..I am stuck here, so please can someone help me?

herez the code
Code:
var a = function(){
  	return Math.floor(Math.random() * (10 - 1) + 1); 
  
};

var b = a();

console.log(b);
JSBIN:
http://jsbin.com/uMUhoJU/2/edit


Thanks