facetwp check a single facet

<script>
        (function($) {
            /**
             * check if a facet exists but is empty, change 'categories' to name of the facet being checked
             */
            $(document).on('facetwp-loaded', function() {
                if ('undefined' !== typeof FWP.facets['categories'] && FWP.facets['categories'].length < 1 ) {
                    // do something if facet is empty
	            }
            });
        })(jQuery);
</script>