Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs

I have an error, and I cannot fix it.


I am making a program with JavaScript using an HTML canvas. Error: Expected '}'.I tried really hard to see what is the error, but all of the braces look even. Help would be appreciated. This is the link to my code:

4 years ago
You are viewing a single comment. View All

Try this:
add this to your html (ABOVE the js source):

<canvas id="game-canvas" width="200" height="200"></canvas>

Then line 3 on the js file changes to this:

context = document.getElementById("game-canvas").getContext("2d");

Please upvote if this helps :)

4 years ago