`x.length - 1`

`-- i` is just broken.