Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. const ran = [];
  2.  
  3. while (ran.length < 10) {
  4. x = Math.floor((Math.random() * 10) + 1);
  5. if (!ran.includes(x)) {
  6. ran.push(x);
  7. }
  8. }
  9. console.log(ran);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement