I think you meant to keep this outside the `while` and actually make use of the split string here, *i.e.*
```coffee
digits = digits.split('')
```

Considering the following code only uses `digits.length` and `digits[]` you don’t even need to split it tbh.