I have the following javascript code:
const theJvScSet = new Set()
while (theJvScSet.size != 10) {
let iniKick = Math.floor(Math.random()*2), setElement = [iniKick]
for (let index = 0; index < 2; index++) {
const spinVal = 1 + Math.floor(Math.random()*5)
setElement.push(spinVal)
}
theJvScSet.add(setElement)
}
And after execution I find myself with twice the value : [0, 3, 5] in the set. How is this possible? I expected the line of code:
theJvScSet.add(setElement)
to only insert in the set values not already in there.
What do I need to change to make sure only different values will be accepted inside theJvScSet?
