Javascript - Challenge
Code Life
By Pierre Marsaa
Shop Catalogue
The shop has a list of items with prices. Build the displays a customer sees, using array methods only.
Step 1: labels is an array of strings "name: X gold" for every item. Print each one.
Step 2: cheap is an array of the names of items costing 50 gold or less. Print "Cheap: " followed by the names joined with a comma and a space (you can build that string with a loop or forEach).
Step 3: print "Expensive items: N" with the number of items above 50 gold.
Expected output:
Loading editor...
↗️
Loading editor...
↶
↷
💡 Show Solution
Continue