Nits: Fixed comment typo and refactored duplicate code.

```javascript
while (++index < length && isWhitespace(string.charCodeAt(index))) { }
```