documentcloud/underscore-contrib — pull request #26 by raganwald (2013-05-10 19:19:14+00:00)
Title: Proposed: _.dictionary is the inverse of _.accessor

_.accessor('a')({a: 1, b: 2})
//=> 1

_.dictionary({a: 1, b: 2})('a')
//=> 1

In short, it turns any object into a dictionary function. Example use: Looking up the next state of a cellular automaton cell from its neighbour count.