documentcloud/backbone — pull request #2082 by akre54 (2013-01-07 00:04:21+00:00)
Title: Add underscore methods (map, keys, values) to models

Re-opening #2040 per @jashkenas: Which underscore methods (if any) should Backbone.Model natively mixin for `attributes` access?

Model is a unique scenario where the hash of attributes may but likely doesn't contain related, iterable data, the type of which underscore methods are particularly useful.

The current method list in the patch is as follows: 'each', 'map', 'contains', 'sortBy', 'groupBy', 'size', 'keys', 'values', 'pairs', 'invert', 'pick', 'omit', 'isEqual', 'isEmpty', and 'chain' (plus aliases).

At the minimum, I think it would be helpful to have `keys`, `values`, `each`, `pick`, `omit`, `isEmpty`, and `size`, and with perhaps a special-case for the `equal` case.