Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //get email id
- let users = [{
- userID: "1",
- userEmail: "user1@email.com"
- },
- {
- userID: "2",
- userEmail: "user2@email.com"
- },
- {
- userID: "3",
- userEmail: "user3@email.com"
- }
- ]
- let getEmailID = users.reduce(function (previous, current) {
- previous.push(current.userEmail);
- return previous;
- }, []);
- console.log(getEmailID)
Add Comment
Please, Sign In to add comment