Ask coding questions

← Back to all posts
ReferenceError: pen is not defined
[deleted]

I try to run this repl but it says:

ReferenceError: pen is not defined

Even though I define it in the setup() function

Answered by Mioun (20) [earned 5 cycles]
View Answer
Comments
hotnewtop
Mioun (20)

write var pen; on the
top line and change word var pen = can.getContext("2d") becomes pen = can.getContext("2d")
I tried and there are no errors but the page is blank whether it's an error code or whatever

[deleted]

@Mioun it works