function attr(key) {
   return function(o) { return o[key]; };
}
Generic form for a function to get a property from an object

   var o = {
      foo:'bar'
   }
   
   var getFoo = attr('foo')
   
   fetFoo(o) // returns 'bar'

@param {String} key the property name