Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program language needed is Javascript 1. Create an array of objects named iPhones (apple products). Each of the objects in the array will represent a
Program language needed is Javascript
1. Create an array of objects named iPhones (apple products). Each of the objects in the array will represent a product. * Each object should have properties for: Product Model Inventory Unit price Color ( an array of colors. Eg: ["Purple, "white, Black, Gold"] The array should contain at least 5 iPhone products (chose your own products) You can use an Apple Store web site if you need help finding the info for your products 2. Add a property to each object called: Extra feature to a value: AirDrop to each of the products. Use .forEach() to add the property to each product. 3. Use the sort() method to sort the array of iPhones by rating the most selling products to less selling (most selling means low inventory) 4. Use the .map() method to create an array of iPhones model from initial dataset named iPhoneModel. 5. Use the reduce() method to find the most selling and less selling product in the data set. Store those objects in a variable named most SellingiPhone and less SellingiPhone 6. Use the filter() method to create an array of products that have color property to "Gold". Store the array in a variable named goldiPhones 7. Display the following in the console with text to describe each value: The name of each product (hint: use .join() to make it look nicer * The most selling iPhones and inventory (in parentheses.) The less selling iPhones and inventory * The products that have a color "Gold" Sample Output: iPhone Product Model: iPhone, iPhone3, iPhone 11, iPhone8, ... Most selling product: iPhone6 (2) Less selling products: iPhone11 (10) Gold iPhone products: iPhone 11, iPhone6...... Note: Create your own products, not the same as your classmateStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started