Just in terms of formatting for readability, it would be good if you included some spaces between tokens. More importantly, you need to use `var i` to avoid making i a global variable. So:

```javascript
for (var i = 0; i < lines.length; i++) {
  if (lines[i] === '\n') {
    lineCount++;
  }
}