I have an array like this:
["Tom","John"]
And I want to convert it to the following json format:
["nameList"]:[{"name":"Tom"},{"name":"John"}]
How to achieve this?
I have an array like this:
And I want to convert it to the following json format:
How to achieve this? |
||||
You can run a
Watch the demo. |
|||
|
Use
|
|||
|
try this:
|
||||
|
{"nameList":[{"name":"Tom"},{"name":"John"}]}
– Pranav C Balan Jun 14 at 7:40