The index.html
file links to products.js
. Loop through the array in products.js
and display each object using HTML.
Provide a default value for the price
property if it is missing.
If the product is sold out, display its name in red otherwise display it in green.
Change the properties in the objects in the array to test your code.
product.html
links to product.js
. Display each property of the object in product.js
using HTML.
Provide a default value for the price
property if it is missing.
If the product is on sale, underline the name.
Change the properties in the object to test your code.