我有一個類型的對象的數組中添加一個新的領域:lodash:一個._map
response.data = [{Name = "name1", Type = "text"}, {Name = "name2", Type = "text"}...]
我試圖做的添加和啓動屬性的所有對象。
我想:
var newObj = _.map([response.data], function (value) {
return {
value: "property : " + value.Name ,
type: "my type is : " + value.Type,
active : false
};
});
但它不添加屬性
你知道如何與lodash做到這一點?