i've got array od values , and i want to take random from it. This is my code:
var bonus1='Opony zimowe';
var bonus2='Alarm';
var bonus3 = 'Bagażnik';
var bonus4 = 'Relingi';
var bonus5 = 'Box na narty';
var bonusy = [bonus1, bonus2, bonus3, bonus4, bonus5];
var pickBonus= bonusy[Math.floor(Math.random() * bonusy.length)];
but it doesnt show random value (Its always console.log - 'Alarm') enter image description here
What is wrong?
Aucun commentaire:
Enregistrer un commentaire