typo:

```
@param {boolean=} if the max ...
```

should be:

```
@param {boolean=} limitMaxPriorityToFirstElement if the max ...
```

Also, I think that it would be useful to explain why this parameter has been added.