Would this slightly shorter version work?

```javascript
arr.sort(function(a,b) {
    return (a.length < b.length) ? 1 : 0;
 });
```