SO - 21903821
by fabricis
JavaScript
function getRandomNonRepeatedInt(limit)
{
var array = [], result = "";
for (var y = 0; y <= limit-1; array.push(y), y++);
while (array.length) result = result + array.splice(Math.floor(Math.random() * array.length), 1)[0];
return result;
}
console.log(getRandomNonRepeatedInt(10));