This does two passes over the items array. You can shorten to a single pass by using `some` instead:

```javascript
var index = -1,
    currentId = this.currentMessage.header.id;
messages.some(function(message, i) {
  if (currentId === message.id) {
    index = i;
    return true;
  }
}.bind(this));
```

This could also be put into a helper, and then allow for a .next() and .previous() instead of 'advance' with a string direction. Some of the tests below then would be split between the functions, make it clear of the separation of logic for each direction.