Learn Basic OOP by Building a Shopping Cart - Step 19

Tell us what’s happening:

The step is saying to use destructuring. I’ve tried alot of the moves with destructuring but it doesn’t pass. Please help.

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 === id);
    const name =  {name};
    const price = {price};
  }

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

Challenge Information:

Learn Basic OOP by Building a Shopping Cart - Step 19

this is not destructuring
I suggest this article to learn more about destructuring

thanks alot for helping ilenia. I’ve read the article and it works.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.