Masīvā atlasiet Nejaušs vienums CSS-triki

Anonim
var myArray = ( "Apples", "Bananas", "Pears" ); var randomItem = myArray(Math.floor(Math.random()*myArray.length));

Skatiet Kriss Koijers (@chriscoyier) Pen gLJPZv vietnē CodePen.