|
|
|
|
|
by chii
1205 days ago
|
|
The original ternary "fixes" the cases where `x` is "wrong" (e.g., is not a string - `x.length` does not fail, but evaluates to false, and thus you still get `<empty>`). This even more terser code will fail if `x.toUpperCase()` fails with an exception (such as when x is not a string). |
|