I am trying to show 3 random values from an array. After the script, only one element is returned from the javaScript array.
var arrayNum = ['One', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'];
var singleRandom = arrayNum[Math.floor(Math.random() * arrayNum.length)];
alert(singleRandom);
But I want to show three random values from an array arrayNum, can anyone guide me on whether it is possible to get 3 unique random values from an array using javascript? I would be grateful if someone would lead me. Thanks you
source
share