here's an example of one that I use:
// Specify the fields to concatenate
var values = [$feature.PreDir, $feature.StreetName, $feature.SufType, $feature.SufDir]
var combined_value = [];
// Loop through the field values and test if they are null or empty strings
// If they are not null or empty add them to an array
for (var i in values) {
var value = values[i];
if (IsEmpty(value)) continue;
combined_value[Count(combined_value)] = value
}
// Return the field values concatenated with a space between
return Concatenate(combined_value, " ");
That should just about do it....