Before answering I would like you to reconsider if you really need/want JavaScript to solve this. For example what happens if the user has JavaScript disabled? And the user will probably see FOUC while the page loads and the JavaScript is fired.
Are you using a framework? If you have control over how the template is generated you might want to prevent the content from being rendered instead of hiding it in the frontend, e.g. using server-side template logic:
<%= Enum.any? @cats do %>
<div class="faq-cat">...</div>
<% end %>
(example using phoenix framework)
If you don't have any control over the template before it's served to the user, you could try something like this in JavaScript:
var fagCat = document.querySelector(".faq-cat");
if (fagCat.querySelector(".empty")) {
fagCat.style.display = "none";
}
Below is a hidden empty faq-cat div:
<div class="faq-cat">
<h3>Text</h3>
<div class="vend-list">
<div id="wpv-view-layout-275-TCPID281CTID23" class="js-wpv-view-layout">
<div class="empty">No items found</div>
</div>
</div>
</div>