The .classify method
%addrbook.classify({ .value.substr(0,1).uc })
- .classify
- applies the block to each element
- returns a list of pairs where
- keys are the values returned from applying the block
- values are arrays of values that produced that key
- In this case, .classify is being applied to %addrbook, which acts like a list of "email => name" Pairs.
- The { .value.substr(0,1).uc } block is applied to each Pair, returning the uppercase value of the first letter of the name.