Boyenerji,
<pre> <script>
class Symbols {
constructor(name, count, see) {
this.name = name;
this.count = count;
this.see = see;
}
}
function randomInteger(min, max)
{
let length = max - min + 1;
let arr = Array.from({length}, (_, i) => min + i);
function shuffle()
{
arr.forEach((_, i) => {
let a = Math.trunc(Math.random() * length);
[arr[i], arr[a]] = [arr[a], arr[i]];
})
return arr.slice(0)
}
let temp = shuffle();
return _ => {
temp.length || (temp = shuffle());
return arr.pop()
}
}
const count = randomInteger(1, 15);
const hotDog = new Symbols('????', count(), true),
poganka = new Symbols('????', count(), true),
hallowen = new Symbols('????', count(), true),
home = new Symbols('????', count(), true),
konfeta = new Symbols('????', count(), true),
sun = new Symbols('????', count(), true);
let arrSimvols = [hotDog, poganka, hallowen, home, konfeta, sun];
document.write(JSON.stringify(arrSimvols, "", 1))
</script></pre>