refactor(util) getNamesFromObjArray: forEach -> map

This commit is contained in:
coderaiser 2015-02-17 08:50:42 -05:00
parent cc8309d046
commit 5e0bbf3ecb

View file

@ -533,8 +533,8 @@
if (!Array.isArray(arr))
throw(Error('arr should be array!'));
arr.forEach(function(item) {
ret.push(item.name);
ret = arr.map(function(item) {
return item.name;
});
return ret;