8_infinite_probability.js 105 B

12345678910
  1. let index = 1;
  2. while (true) {
  3. if(Math.random() > 0.9) {
  4. break;
  5. }
  6. index++;
  7. }
  8. alert(index);