this can simply be:
```javascript
function checkLength(text, maxLength) {
    return text.length <= maxLength
}
```