Learn Intermediate OOP by Building a Platformer Game - Step 91

Tell us what’s happening:

I am stuck here. The step is to check if the platform detection rules are true using the every method. Please help me figure this out. Thank you!

Your code so far

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

/* file: styles.css */

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

if (platformDetectionRules.every(rule => rule === true)) {};

// User Editable Region

Your browser information:

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

Challenge Information:

Learn Intermediate OOP by Building a Platformer Game - Step 91

Hello,
Your answer is not wrong but you don’t need to control each rule with rule===true because when you use the every method on an array with conditions, the condition inside the every method’s callback is expected to return a boolean. So rule already boolean and no need to control with equal operator. Just make it simple, you will pass this step.

1 Like

okay, I see what you mean, because the rule checks already if the rule is true. I removed the strictly equal operators and the true statement and it passed. Thank you very much for your help!

1 Like