Easy there, pal!
To access the Introduction to JavaScript in the browser challenges in the Deep dive in JavaScript for browsers, you need to sign up first.
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 the
assortmentDataarray. Each object represents one product and has the following properties:
inStock: if the value istrue, the ice cream is in stock; if it isfalse, the ice cream is out of stock.isHit: if the value istrue, 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.Write the code as an
updateCardsfunction, which accepts an array of product data. Call it withassortmentDataas the argument.
Press Hey boss, here’s your program! to call the Boss. He will check if your program is working correctly. Good luck!
You’ve gone to a different page
Click inside the mini-browser to shift the focus onto this window.
To access the Introduction to JavaScript in the browser challenges in the Deep dive in JavaScript for browsers, you need to sign up first.
Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.
Forgot to connect your email to the profile? Email us and we’ll help.