Learn Asynchronous Programming by Building an fCC Forum Leaderboard - Step 33

Tell us what’s happening:

I don’t understand why my code isn’t passing the test. I tested it on my own system and it seems to be working fine.

Your code so far

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

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

const forumCategory = (id) => {
  let selectedCategory = {};
  if (Object.hasOwn(allCategories, id)) {

  }
};

// User Editable Region
/* file: styles.css */

Your browser information:

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

Challenge Information:

Learn Asynchronous Programming by Building an fCC Forum Leaderboard - Step 33

Hi @fcc4b6d10c4-b540-4e2

Create an if statement to check if the allCategories object has a property of id. Remember, you can use the hasOwnProperty() method for this.

You should have an if statement that checks if the allCategories object has a property of id

Your code is accessing the incorrect object.
Also, you need to use the method mentioned in the instructions.

Happy coding

Thanks to your post, I changed my code to use the syntax for hasOwnProperty() — and it passed the test.

I originally used hasOwn() because MDN’s JavaScript Reference recommended it and says it’s meant to replace hasOwnProperty().

1 Like