Created
September 5, 2017 07:45
-
-
Save ibihim/194d2422ef24e0fa425f08c24e416e07 to your computer and use it in GitHub Desktop.
Power of reduce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getAuthData = (users) => | |
users.reduce((authObj, user) => { | |
const { roles, organizations, clients } = user; | |
authObj.userRoles.push(roles.toStirng()); | |
authObj.organizations.push(organizations.toString()) ; | |
authObj.userClient.push(clients.toSring()) ; | |
}, { userRoles: [], organizaionts: [], userClients: [] }); |
Author
ibihim
commented
Sep 5, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment