Question: Javascript ES6 4. Write a higher order function called iteratelnventory (15 pts) This iteratelnventory function returns an updated inventory array with status This iteratelnventory function

Javascript ES6

Javascript ES6 4. Write a higher order function called iteratelnventory (15 pts)

4. Write a higher order function called iteratelnventory (15 pts) This iteratelnventory function returns an updated inventory array with status This iteratelnventory function accepts two arguments an inventory array and an evaluatelnventory function The iteratelnventory function iterates over the inventory array using .forEach() and performs evaluatelnventory The evaluatelnventory function adds a status to each item based on stock count and returns the item Stock count of 3 or more the status is 'OK' Stock count of 1 to 2 the status is 'LOW' Stock count of O is OUT OF STOCK const inventory = [ { item: 'Sony PS4 Pro', price: 399.99, stock: 3 }, { item: 'Atari', price: 125.0, stock: 0 }, { item: 'Microsoft Xbox One X', price: 499.99, stock: 1 }, { item: 'Nintendo Switch', price: 299.99, stock: 4 }, { item: 'Sony PS2 Console', price: 299.99, stock: 1 }, { item: 'Nintendo 64', price: 199.999, stock: 2 }, { item: 'Sega Genesis', price: 104.0, stock: 0 } li EXPECTED OUTPUT (array of objects): { item: 'Sony PS4 Pro', price: 399.99, stock: 3, status: 'OK' }, { item: 'Atari', price: 125, stock: 0, status: OUT OF STOCK' }, { item: 'Microsoft Xbox One X', price: 499.99, stock: 1, status: 'LOW' }, { item: 'Nintendo Switch', price: 299.99, stock: 4, status: 'OK' }, { item: 'Sony PS2 Console', price: 299.99, stock: 1, status: "LOW" }, { item: 'Nintendo 64', price: 199.999, stock: 2, status: "LOW" }, { item: 'Sega Genesis', price: 104, stock: 0, status: 'OUT OF STOCK' }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!