var r = 0;
for (let i = 0; i < 20; i++) {
  r = Math.floor(Math.random() * 3);
  console.log(r);
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.