Comment Comment by kennywinker Sure, but in that case string | undefined is the correct type, and turning it into string | “” isn’t helping anybody.It’s the difference between:if (fooBarDisplayName) { show div }And:if (foobarDisplayName && foobarDisplayName.length > 0) { show div }Ultimately, type systems aren’t telling you what types you have to use where - they’re giving you tools to define and constrain what types are ok. parent kennywinker 11 months ago
It’s the difference between:
if (fooBarDisplayName) { show div }
And:
if (foobarDisplayName && foobarDisplayName.length > 0) { show div }
Ultimately, type systems aren’t telling you what types you have to use where - they’re giving you tools to define and constrain what types are ok.