Hide a text element if it contains the value '0'

Hello,

I have a comment counter attached to each item in a repeater, it works great, only I’m trying to have it hidden if the comment counter’s value is ‘0’, I tried this and it didn’t work :

$w("#repeater2").onItemReady( ($w, itemData, index) => {
			$w("#repeater2").forEachItem( ($w) => {
				
				wixData.query("commentaires")
	  			.contains("reference", $w('#referenceText').text)
	  			.find()
		  			.then( (results) => {
						let numberOfItems = results.totalCount;
						$w('#nbrComments').text = numberOfItems + '';
					});
				
				if ($w("#nbrComments").text === "0") $w("#nbrComments").hide();
				//hides 'evenement' button if label is empty
				($w("#button46").label === "") $w("#button46").hide();
				//NOTE : this code above works, but not the one in bold

});
});

Any idea why this doesn’t work ? I’ve tried many different combinations but still no dice.

bump ! my website’s release is planned for tomorrow !