An index is a numeric position identifying an element in an array. Functions such as indexOfItem() return that position so higher-level operations can find, update, or remove an item. section 8.7
Indexing supports several layers of cart behavior:
- Keep indexing below higher-level functions such as isInCart(), which returns a boolean instead of exposing the array structure. section 8.7














