I get return value as null and assign that value it shows as null in the UI. But I want to check some condition and if it is null, it should not show up anything.. I tried the below code and it doesn't work
var companyString;
if(utils.htmlEncode(item.companyname) == null)
{
companyString = '';
}
else{
companyString = utils.htmlEncode(item.companyname);
}
var companyString=" "?item.companynameto null (but probably really any false-y value), not the encoded form.