function allMarkersOnMap() {
  const allMarkers = document.querySelector(".all-markers strong");
  let allMarkersCount = 0;

  // loop through all layers
  map.eachLayer((layer) => {
    // if layer is a marker
    if (layer instanceof L.Marker) {
      // increase counter
      allMarkersCount++;
    }
  });

  // update counter
  allMarkers.textContent = allMarkersCount;
}
count markers
idea taken from
https://stackoverflow.com/questions/71394950/counting-markers-in-a-layer-in-leaflet-and-add-it-to-a-div