r/learnjavascript • • 16h ago

How do I make multiple objects with different names from the same code?

4 Upvotes
function makeNewFood() {
totalNumOfFood = totalNumOfFood + 1;
let (foodOClone+totalNumOfFood) = structuredClone(foodO);
};

This is my pseudocode I need help with. I want it to make a new object called "foodOClone1" then "foodOClone2" etc.
Thanks for the help.

For next time: Did I include enough detail and if not, what other details can I include