Learn Basic OOP by Building a Shopping Cart - Step 18

Tell us what’s happening:

Although I know what to do, I’d like to know if my syntax is wrong, or if I wrote it the wrong way,

Your code so far

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

/* file: styles.css */

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

  addItem(id, products) {
    const product = products.find((item) => item.id === this.id ? true:false);
  }

// 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/127.0.0.0 Safari/537.36

Challenge Information:

Learn Basic OOP by Building a Shopping Cart - Step 18

Almost correct, first there is no need to use the this keyword here since the id is a parameter passed to the function, so remove this keyword
Second, the result of a comparison operation in programming will result implicitly in true or false, there is no need to explicitly return a true or false
here is an example, consider function that takes two numbers, it returns true is the first one is greater than the second and false otherwise

const compareNumbers = (a, b)=> a > b;

this is similar to your callback function here