samedi 25 septembre 2021

Making arrays containing random & unique numbers - JavaScript

I have an array which contains number from 0 to 20 .
var array1 = [0,1,2,.....18,19,20];
I want to make three arrays and each array will contain seven random and unique numbers from array1
How can I do this with JavaScript ?
Example:
[2,9,6,13,5,17,20]
[3,18,7,12,15,1,4]
[8,10,14,16,11,0,19]




Aucun commentaire:

Enregistrer un commentaire