You are viewing a single comment's thread. Return to all comments →
case comparisons are done using ===, so this is the same as if Hacker === obj ... (and so on). The === method of Class is inherited from Module, and is documented as:
if Hacker === obj ...
"Returns true if obj is an instance of module or one of module 's descendants. Of limited use for modules, but can be used in case statements to classify objects by class."
So it's also asymmetric - "k" === String is false, but String === "k" is true.
"k" === String
String === "k"