on-internet
← Community

How to convert Map to array of objects?

Stack Overflow ·

I'm trying to convert a Map into array of objects Lets say I have the following map: let myMap = new Map().set('a', 1).set('b', 2); And I want to convert the above map into the following: [ { "name": "a", "value": "1", }, { "name": "b", "value": "2", } ]

Comments

Sign in or sign up to comment and upvote.

No comments yet.