Errors where a loop iterates one time too many or too few.
An 'off-by-one' error occurs when a loop iterates one more or less time than intended. In a cart, if you loop from 0 to cartItems.length instead of 0 to cartItems.length - 1, you risk accessing an index that doesn't exist. Correcting this ensures accurate processing.