+ 1

Event that triggers at random time intervals

How do I create an event that triggers at random time intervals with JavaScript?

1st Sep 2020, 9:58 AM
Unrealistic Engineer
Unrealistic Engineer - avatar
2 Antworten
+ 2
let a=Math.floor(Math.random()*500); setTimeout(print,a) function print(){ a=Math.floor(Math.random()*7000); document.body.innerHTML=""+a; setTimeout(print,a); };
1st Sep 2020, 10:10 AM
Abhay
Abhay - avatar
+ 1
Thank you!
1st Sep 2020, 10:29 AM
Unrealistic Engineer
Unrealistic Engineer - avatar