let's say I have two arrays:
var meals: ["breakfast", "lunch", "dinner"];
var ingredients: [["eggs", "yogurt", "toast"],["falafel", "mushrooms", "fries"], ["pasta", "cheese"];
Is there an elegant solution to create an array of JavaScript objects which features:
var dailySchedule = {"breakfast" : ["eggs", "yogurt", "toast"],
"lunch": ["falafel", "mushrooms", "fries"],
"dinner": ["pasta", "cheese"]
}
I know it should be something with .reduce but I keep scratching my head how to do it...
for(...)
loop :)