Arrays in Javascript

How i print my array element randomly
like if arr[1,2,3,4,5]

so its prints like 32145,12435,12325 like this

please tell is there any way

There is no function built as such you have write it independently
function shuffle(arra1) {
var ctr = arra1.length, temp, index;

// While there are elements in the array
while (ctr > 0) {
// Pick a random index
index = Math.floor(Math.random() * ctr);
// Decrease ctr by 1
ctr–;
// And swap the last element with it
temp = arra1[ctr];
arra1[ctr] = arra1[index];
arra1[index] = temp;
}
return arra1;
}
var myArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
console.log(shuffle(myArray));

You can follow the above code for same