Why my for loop is not drawing multiple repeated shapes in the html canvas sketch?

<html> <body> <canvas width = "1200" height = "1200"> </canvas> <script> let canvas = document.querySelector('canvas'); let context = canvas.getContext('2d'); context.fillStyle = '#5bd75b'; context.fillRect(0, 0, 1200, 1200); let radius = 500; for (let i = 1; i <= 10; i++) { if (Math.random() >= 0.5) { context.fillStyle = 'yellow'; } else { context.fillStyle = 'red'; } … Read more