console.log("Exporting Module"); const shippingCost = 10; const cart = []; const addToCart = function (product, quantity) { cart.push({ product, quantity }); console.log(`${product}, ${quantity} added to cart`); }; const totalPrice = 237; const totalQuantity = 21; export { totalPrice, totalQuantity as tq, addToCart }; export default function (product, quantity) { // default export braucht keinen Namen. Bei der Importierung eines solchen Export, // kann man egal welchen Namen zuweissen, in unserem Fall ist es einfach als add Function bennant worden (sehe die Datei script.js import add from "./shoppingCard.js";) cart.push({ product, quantity }); console.log(`${product}, ${quantity} added to cart`); }