I need help converting my object to a list before passing it as a parameter to my API. I have tried using Object.keys but the output is not as expected.
Object.keys(myobj).map(function(key){
---logic
});
The API returns a list of objects like this:
[{Name : "sachin",Age : 30},{Name : "Ramesh",Age : 35}]
When I use the find method in Angular, the object from the list looks like this:
{Name : "sachin",Age : 30}
Now I need to change the Age property value to 42 and convert it back to a list before passing it to the API.
[{Name : "sachin",Age : 42}]
If anyone can assist me in achieving this result, it would be greatly appreciated.