Random number which hasnt been used

How will i get a random number (between two integers) which has not been used in the previous frame? (this function will go on till
all the numbers have been used)

In JS please

use a list or array, get random number from 1 to count of items, remove item. do it until finished.