Convert object to list in Typescript

I want to convert my object to list while passing as param to my API. I am not sure how to achieve this. I tried Object.keys but not getting expected output.

Object.keys(myobj).map(function(key){
---logic
});

I am receiving list of objects from API:

[{Name : "sachin",Age  : 30},{Name : "Ramesh",Age  : 35}]

In Angular, When I use find method it converted as object from the above list and it looks like below.

 {Name : "sachin",Age  : 30}

Now I have to change Age property value as 42 and pass it to API as list.

[{Name : "sachin",Age  : 42}]

Can someone help me to achieve this result.



Read more here: https://stackoverflow.com/questions/64943120/convert-object-to-list-in-typescript

Content Attribution

This content was originally published by Ask_SO at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: