I'm using canvas and i'm trying to draw an image to the canvas but it doesn't work. I found that I need to use eventListener but it didn't fix it. can someone tell me what's wrong.
const c = document.getElementById("myCanvas");
const ctx = c.getContext("2d");
const groundImg = new Image();
groundImg.src = "ground.png";
groundImg.addEventListener("load", startDraw());
function startDraw() {
ctx.drawImage(groundImg, 0, 0, c.width, c.height);
}