The domain of the function is the set of capital city names, where the rule holds. For words that are not capital city names, the function returns 'undefined'.