Lists and objects
Also called Array, Dictionary
A list, called an array, holds values in order, numbered from 0. An object holds values under names, like a small form. Both live in a box in memory, and a variable holds a pointer to the box, not what is in it.
That pointer is behind a whole family of bugs where you change a "copy" and the original changes too. Spot them by asking if the code made a new box or only a new name. JSON, from the network chapter, is these same two shapes written out as text.
Say it to your agent
“Don't mutate the cart argument in applyDiscount. Return a new object with a new items array, and add a test that checks the original cart is unchanged after the call.”