I have an array with 10 elements, and I want to draw 5 different elements from the array without repeating.
I tried with this code, but this solution can repeat the drawn values:
var myArray = ['1', '2' ....];
for (var i=1; i <= 5; i++)
{
var randomItem = myArray[Math.floor(Math.random()*myArray.length)];
console.log(randomItem );
}