let f = obj => obj/4
function onePersonMeal() { return { ...meal, recipe: { rum: meal.recipe.rum / 4, cola: meal.recipe.cola / 4 } } }
let meal = { name: "RumCola", recipe: { rum: 1000, cola: 2500 }, quantity: 4 }; function onePersonMeal(obj) { const {quantity, recipe} = obj; const {rum, cola} = recipe; return `RUM: ${rum / quantity} COLA: ${cola / quantity}` } onePersonMeal(meal)
Обсуждают сегодня