How to return value using angular foreach?

How to return value using angular foreach?

I am facing some issue while returning value from angular forEach.

I am facing some issue while returning value from angular forEach.

Here is my data:

vm.memberDetails={
    "member": [
        {
            "firstName": "HARRY UTTWO",
            "lastName": "POTTER",
        }
    ],
    "User": [
        {
            "memberId": 7586671,
            "customerId": 7586671,
            "customerStatus": "T",
            "firstName": "HEMOOINE",
            "lastName": "POTTER",
        },
    ]
}

vm.mockData = { "data": [{ "memberNo": 7586671, "suffix": "A" }] }

Here I need to compare memberId and get name from first data.I used angular.forEach but for name i need to use

vm.memberDetails.User[0].firstName but it return only on value with looping.

Controller:

angular.forEach(vm.memberDetails.User, function (value1,key1) {
    angular.forEach(vm.mockData, function (value2,key2) {
        if (value1.memberId === value2.memberNo) {

        vm.some= vm.memberDetails.User[0].firstName;
    }
});

}); return vm.some;

Any help would be appreciated. Thanks.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

What are the differences between the various JavaScript frameworks? E.g. Vue.js, Angular.js, React.js

What are the differences? Do they each have specific use contexts?