I know that there are better ways to check for an empty string—bear with me.
This is not checking for empty string in general. I'm actually doing something like:
var s = /*who knows?*/;
switch (s.charAt(0)) {
// ...
}
and wanted to know if I can avoid having to do an extra if (!s)
.