mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(util) getNamesFromObjArray: forEach -> map
This commit is contained in:
parent
cc8309d046
commit
5e0bbf3ecb
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue