The values ‘undefined’, ‘null’, ‘0', NaN and empty string are all falsy values.
Francis Bacon-Desrosiers
11
Yep you’re write Francis! But this code isn’t checking for falsy values. It’s checking for invalids. If my code expects a variable to be a string, and it’s somehow a number (non-zero), it’s pretty much invalid though it’s not a falsy value. Here my use case for the string operations is that anything which is not a non-empty string is invalid for those titleize and other operations.
That’s why there’s a nothing value which I can customise according to code. It’s always meant to represent invalid. Thanks a bunch for responding and hope this makes sense.