On 05/06/2022 07.06, Koushik Romel wrote:
> I want those #One and #Two to be in curly braces {} and not as square
> bracket [] , and Thanks in advance
A good start would be to understand what the difference between square
brackets and curly braces is. The JSON format is very simple:
https://en.wikipedia.org/wiki/JSON#Syntax
So you actually want to convert your array to an object with anonymous
properties/members. That doesn't really make any sense and wouldn't be
valid JSON.
Of course you could write a dirty hack and do it anyway but I seriously
doubt that's really what you want.
Hope that helps.
Kind regards,
Kasper Laudrup