I'm trying to show 3 random values from an array. Following script is returning only single item from 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 value from array arrayNum
, can any one guide me is this possible to get 3 unique random values from an array using javascript? I will appreciate if someone guide me. Thank you