As we are looking for length > 0, we can use <code>find</code> as it stops when the first match is found,
```coffeescript
requiredRange = ranges.find((item) ->
  item.text.replace(/\ /g, "") == date
)
requiredRange?
```