> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# loop-index-past-length

> A loop runs its index up to and including length, so the last pass reads past the end.

## What it flags

A `for` loop starts at `0`, runs `i <= items.length` and reads `items[i]`, so the last pass reads past the end. Loops starting at `1` are accepted. The fix changes `<=` to `<` and is marked for review.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "loop-index-past-length": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.