Created
February 1, 2021 15:22
-
-
Save stoneboyindc/8eff782439dfe09990b321793dc2542b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function allCandyOrders(inventory) { | |
let result = {}; | |
for (let i=0; i<inventory.length; i++) { | |
if (inventory[i].inStock < inventory[i].weeklyAverage) { | |
result[inventory[i].candy]= inventory[i].weeklyAverage * 2; | |
} else { | |
result[inventory[i].candy] = 0; | |
} | |
} | |
return result; | |
} |
Author
stoneboyindc
commented
Aug 30, 2021
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment