Learn Intermediate OOP by Building a Platformer Game - Step 73

Tell us what’s happening:

Step 73

Inside the animate function, you will need to draw each of the platforms onto the canvas.

Add a forEach loop that iterates through the platforms array.

Inside the callback function, add a platform parameter and for the body of the function call the draw method on each platform.

Your code so far

No Idea why below code not pass. The hints pop out is " You should have a forEach loop that iterates through the platforms array." Please help.

platforms.forEach((platform) => platform.draw()); 

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Learn Intermediate OOP by Building a Platformer Game - Step 73

The test is accepting a fixed solution like this

platforms.forEach((platform) => {platform.draw()});

I have created an issue to have the tests fixed

3 Likes