Instantly share code, notes, and snippets.

Embed
What would you like to do?
A Web History
// myShirt.js now have dependencies, the shopping cart and the inventory
// module in the same directory as myShirt.js
define (["./ cart", "./inventory"], (cart, inventory) => {
// returns an object to define the module "myShirt".
return {
color: "blue",
size: "large",
addToCart: () => {
inventory.remove(this);
cart.add(this);
}
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment