let {ingredients, originalportioncount} = input; let ing = []; if (!Boolean(originalportioncount)) { return "⚠️ Warning\nYou have not specified the original serving size!\nIngredient amounts cannot be estimated." } for (let i = 0; i < ingredients.length; i++) { let name = ingredients[i].replace(ingredients[i].split(" ")[0] + " " + ingredients[i].split(" ")[1], ""); let unit = ingredients[i].split(" ")[1]; let amount = ingredients[i].split(" ")[0]; ing[i] = "🥣 " + (amount / originalportioncount * dv.current().ServingSize) + " " + unit + " " + name + "" } dv.list(ing)