// Mutating an argument changes data the caller still holds.type Cart = { items: string[]; total: number };const addItem = (cart: Cart, item: string, price: number): Cart => { cart.items.push(item); cart.total += price; return cart;};console.log(addItem({ items: [], total: 0 }, "tea", 3).total);