How to count modular visible (short way)

I need to know how many modulars are visibles, i find a way with a loop but trying to find a “short way” like with pages.children.visible|length

{# COUNT PAGES VISIBLE #}
{% set page_visible = pages.children.visible  %}
{% set totalpagevisible = page_visible|length %}

{% set totalmodularvisible = 0 %}
{% for modular in page.collection() %}
   {% if modular.header.visible %}
      {% set totalmodularvisible = totalmodularvisible + 1 %}
   {% endif %}
{% endfor %}
---
page.collection.modular|length

@rhukster thanks