Functions task- 2 clarity

Hi, pls, in this functions task-2 test your skills, I m wondering, through my lessons so far, canvas and drawing shapes inside it has only been mentioned in passing, and as such, i haven’t paid much attention to it, hoping it is a topic that visited later.

I want to know if i m supposed to solve it with reference from previous lessons, or if I m to go further and read up a bit on it, before attempting to create the draw function?

Functions 2

For our second functions-related task,

you need to create a function that draws a rectangle on the provided <canvas> (reference variable canvas , context available in ctx ), based on the five provided input variables:

Hi @payiyke

It’s a bit of both. The code from this previous chapter should help:

We don’t need the loop and instead of the circle (ctx.arc()), you’ll need ctx.fillRect(). I recommend reading this page to understand how to use it:

I think with this information you should be able to solve the task.

Feel free to ask, if you need more help.

Have a nice weekend,
Michael