uris77
11/15/2012 - 3:59 AM

JS extract an object's property

JS extract an object's property

function property(name){
   return function(object){
      return object[name];
   };
};

//Use
var getName = property("name")
var name = getName({name: "Roberto"});
myMap.map(property('name')).join(", );