Learn Intermediate OOP by Building a Platformer Game - Step 59

Tell us what’s happening:

Cant seem to find a solution. Keep getting this error = You should use the destructuring assignment to get the key property from the event object. I have created the event listener, added the keydown event in quotes and used the object destructuring in parentheses as the second parameter in the event listener with an empty arrow function.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

window.addEventListener('keydown', ( const { key } =  event  ) => { 
});

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

Challenge Information:

Learn Intermediate OOP by Building a Platformer Game - Step 59

:balloon:Hello @officialkolade!

Welcome to the forum!

Have a look at this post (You will need to ignore the step number as this doesn’t match).

There are some syntax errors in your code though, but with all the purported attempts you made these may be as a result of those.

Does this help?

Keep up the good progress!

Happy Coding! :slightly_smiling_face:

yeah, it helped. thank you :pray:

1 Like