Custom loop with data limit

I want a custom loop with data limit, anyone can help me like

{% for p in taxonomy.findTaxonomy({‘category’:‘featured’}) %}
{{ p.title }}
{% endfor %}

Thanks

Something like this should work:

{% for p in taxonomy.findTaxonomy({'category':'featured'}) %}
   {% if loop.index <= 5 %}
      {{ p.title }}
   {% endif %}
{% endfor %}