← Problems
import { checkout } from "./checkout";
import { createStore } from "./store";

const store = createStore();
const result = checkout(store, [
  { productId: 1, quantity: 2 },
  { productId: 2, quantity: 1 },
]);

document.getElementById("out").textContent =
  JSON.stringify({ result, stock: store.products.map((p) => [p.name, p.stock]) }, null, 2);

PreviewOpen in new tab ↗Tests

Tests only run when you press ▶ Run tests (next to the Tests heading). Run them again after each change.

Open browser consoleTests

/index.jsJS