Interactive online courses HTML Academy
2026-03-09 14:10 Diff

Muffin liked how you coped with the puncher store task and entrusted you with one more combat mission.

Meow! We must display the current state of the products on the store website: “in stock”, “not available”, “bestseller”.

Product data is stored in an array with assortmentData objects, each object corresponds to one product and contains the following properties:

  • inStock: if the value is true, ice cream is available, if it is false, the products is out of stock.
  • isHit: if the value is true, the ice cream is the most popular among customers.

Each product state corresponds to a special class:

  • Product in stock: good--available.
  • Unavailable product: good--unavailable.
  • Bestseller: good--hit.

Design the code as the updateCards function, which accepts data arrays. Call it by transferring assortmentData.

Press Hey boss, here’s your program! to call the Boss. He will check if your program is working correctly. Good luck!