Macros¶
Extend Collection with custom methods using macros.
Collection.macro('pluck', function(key) {
return this.map(item => item[key]);
});
collection.pluck('name');
Extend Collection with custom methods using macros.
Collection.macro('pluck', function(key) {
return this.map(item => item[key]);
});
collection.pluck('name');