The previous demo built one library reminder. Now the pantry needs one line per request, with a quantity and a clean recipient name. Run the starter, then replace the unfinished functions to see the actual notices in the Console.
Each request is an object with name, item, and quantity. Keep the supplied requests as data; your functions should also work for other requests.
A separate book reminder shows how to trim a name before interpolation:
function bookReminder(name, title) {
return `Hi ${name.trim()}, ${title} is ready.`;
}
console.log(bookReminder(" Eva ", "Field Notes")); // Hi Eva, Field Notes is ready.
formatPickup(name, item, quantity) as a returned template-literal notice, trimming the name; do not log inside it. The supplied CHECK call uses Lee, meal kits, and 1.buildPickupList(requests) by mapping through formatPickup and joining with newline; an empty list returns "".buildPickupList(requests) as a separate message with the two supplied notices on separate lines.Trim the recipient's name before inserting it into the message.
Map each request to formatPickup, then join the messages with a newline.