Challenge 2: Proving beforeEach Actually Resets State — Possible Solution ==================================================================== let cart; beforeEach(() => { cart = []; }); describe("cart", () => { it("starts empty", () => { expect(cart).toEqual([]); }); it("has length 1 after adding one item", () => { cart.push("apple"); expect(cart.length).toBe(1); }); it("is empty again in a fresh test, even after the previous test added an item", () => { expect(cart).toEqual([]); }); }); WHY THIS WORKS AS AN ANSWER ------------------------------ cart is declared outside beforeEach (with let, not const) so the same variable can be reassigned before each test, rather than redeclared — beforeEach resets it to an empty array before EVERY test in the describe block runs, exactly as this chapter described. The second test pushes an item and checks cart.length === 1 — proving adding an item works as expected, using toBe since length is a primitive number. The THIRD test is what actually proves the reset works, not just the comment claiming it does: if beforeEach were NOT running between tests (say, it only ran once via a beforeAll instead), this third test would see the "apple" item still sitting in cart from the second test, and expect(cart).toEqual([]) would FAIL. Since this test passes, it demonstrates concretely that beforeEach really does reset cart before every single test, not just once at the start of the suite — directly verifying the isolation guarantee this chapter's Setup and Teardown section described, rather than just taking it on faith.