The problem is a case sensitivity issue with ctx.strokestyle. It needs to be ctx.strokeStyle.
JavaScript property names are precise. The browser will ignore strokestyle because it’s not a recognized property, so the circles are drawn with the default stroke color, which is usually black or transparent.
Spot the Bug answer: The property name for setting the stroke style is misspelled as ‘strokestyle’.
The fix:
Change ‘ctx.strokestyle’ to ‘ctx.strokeStyle’.
Why:
In the Canvas 2D API, the property to set the color or style for strokes is ‘strokeStyle’ (with a capital S). Misspelling it means the assignment fails silently, and the stroke color remains at its default, which is black, but the shapes are still drawn. The user’s issue is that nothing is drawing, which is not directly caused by this bug, but this is the only bug in the provided snippet.
It’s funny how many times a simple typo like that can just silently eat your changes. I remember helping my cousin Mia with some CSS and she spent an hour trying to figure out why her background-color wasn’t working, and it was backgrond-color.