I'm getting an array from an API, like this:
Array(4)
0:{email: "mail@mail.com", name: "Billie", lastName: "Jean",
id: "5b6f79"}
1:{email: "mail@mail.com", name: "John", lastName: "Doe",
id: "8b6z75"}
...
What I want is to extract the id
to use it in my class to construct an URL like ${this.sellerData}/clients/ID
where the ID is the one from the array.
I have tried this:
this.sellerClients = data.clients;
console.log (this.sellerClients);
//prints the array in console
for (let clientid of this.sellerClients ) {
console.log(clientid);
clientid = this.clientIdNumber;
}
But I only get an object with the values:
{email: "mail@mail.com", name: "Billy", lastName: "Jean", id: "5b6f79"}
...
Thank you for your help!