I'm developing a Web project related to an A / B test system, and I need a function that generates random numbers from 1 to 3 strong> without repeating the ones that have already been generated.
function getRandom(max){ return Math.floor(Math.random() * max + 1); }