#JavaScript#randomization
Randomization can be a useful tool in generative art.
Here is a useful utility that is true once every n times, on average.
function onceEvery(n) {return Math.floor(Math.random() * n) === 0;}
and an example:
if (onceEvery(10)) {console.log('This fires randomly with odds 1:10');} else {console.log('This fires randomly with odds 9:10');}