I have JSON in which all the values have to be changed to string. The values may be a number, boolean, undefined or null.
{
"obj1": [{
"n1": "n",
"n2": 1,
"n3": true
},
{
"n1": "n",
"n2": 1,
"n3": null
}]
}
Run Code Online (Sandbox Code Playgroud)
The expected result is all the values should be formatted as a string.
Example:
{
"obj1": [{
"n1": "n",
"n2": "1",
"n3": "true"
},
{
"n1": "n",
"n2": "1",
"n3": "null"
}]
}
Run Code Online (Sandbox Code Playgroud)
By iterating through …