Question: I have a list of users store in an array

```json
accountsade: [
    {
        id: 0.4387810413935975
        name: "Adrian"
        password: "345"
        userName: "nathanael"
    },
    {
        id: 0.2722524232951682
        name: "Nathan"
        password: "123"
        userName: "nathanaelmbale45"
    }
],

```

And I want to loop through the list of users and capture the values `password`, and `username`
of every single object in the array and compare them to already existing variables.

```
usernameL = "nathanaelmbale45"
passwordL = "123"

```

Answer: 
```
    <script>
    let accountsade = [
        {
            id: 0.4387810413935975,
            name: "Adrian",
            password: "345",
            userName: "nathanael",
        },
        {
            id: 0.2722524232951682,
            name: "Nathan",
            password: "123",
            userName: "nathanaelmbale45"
        }
    ]
    let userName = 'nathanael', password = '345';
    let account = accountsade.filter((item) => {
        return item.userName === userName && item.password == password;
    });
    console.log(account);
</script>

```

-----------# output #-----------------

```
[{"id":0.4387810413935975,"name":"Adrian","password":"345","userName":"nathanael"}]

```
1. to capture just map over the array and return the required fields

objectArrap.map(object=>({object.property, object.property2}))

to compare you can use similar methods called filter and find. If you need to do something specialized consider looping over each object with objectsArrray.foreach