diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2017-06-01 05:01:23 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2017-06-01 05:01:31 +0300 |
commit | af6e4ae900896931503073e2f74dd497ccf6a60d (patch) | |
tree | 3c146454ce1ade4d61f1457c1b06ff75b53bfc49 /app/assets | |
parent | 0a1b196643110380ec1fa672bfd829fb79a691a6 (diff) |
Use map to iterate arrays
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/groups/stores/groups_store.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/groups/stores/groups_store.js b/app/assets/javascripts/groups/stores/groups_store.js index d343b61f378..06ef3b268e3 100644 --- a/app/assets/javascripts/groups/stores/groups_store.js +++ b/app/assets/javascripts/groups/stores/groups_store.js @@ -44,11 +44,11 @@ export default class GroupsStore { const orphans = []; // Map groups to an object - for (let i = 0, len = groups.length; i < len; i += 1) { - const group = groups[i]; + groups.map((group) => { mappedGroups[group.id] = group; mappedGroups[group.id].subGroups = {}; - } + return group; + }); Object.keys(mappedGroups).map((key) => { const currentGroup = mappedGroups[key]; |